Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

affine transform issue (divided by zero) #28

Open
AtousaTorabi opened this issue Apr 19, 2018 · 11 comments
Open

affine transform issue (divided by zero) #28

AtousaTorabi opened this issue Apr 19, 2018 · 11 comments

Comments

@AtousaTorabi
Copy link

AtousaTorabi commented Apr 19, 2018

Hi,
Thanks for great work to do augmentation without server. I get divided error by zero when training at affine function in this line:
scale_size = config.transform_params.target_dist / (scale_self * self.scale)
seems scale might be zero sometimes.

Thank you!

@abinjoabraham
Copy link

Even I am facing the same issue now. I will post if I find a solution. @AtousaTorabi

@murrayLuke
Copy link

Interesting that could explain the NaN and inf values I've been seeing.

@abinjoabraham
Copy link

Still I am stuck in this situation .

@murrayLuke
Copy link

I don't think it would be too hard to write a one liner and change the scale size if it is 0.

@abinjoabraham
Copy link

I have wrote a simple if statement to skip the 0 of the scale size. But not sure what value I need to give to scale size if it is 0.

@murrayLuke
Copy link

murrayLuke commented May 2, 2018 via email

@abinjoabraham
Copy link

Tried the same and it is running. But the loss is going nan.

@anatolix
Copy link
Owner

anatolix commented May 7, 2018

neither scale_self nor self.scale shouldn't be zero. scale_self taken from hdf5, check dataset generation, may be we need to put assert there.

@abinjoabraham
Copy link

Issue is not anymore for me. I put an assert in the dataset generation file and also changed the first learning rate of the epochs.

@YicongHong
Copy link

YicongHong commented Jun 22, 2018

@abinjoabraham I tried to add an if condition in the data generation file to avoid divide by zero:
if (img_anns[p]["bbox"][3]) == 0: pers["scale_provided"] = 1
but the loss is going nan, I am wondering how exactly should I modify the dataset generation file and change the first learning rate?

@abinjoabraham
Copy link

@YicongHong Exact lines are below

    if pers["scale_provided"]==0:      
        pers["scale_provided"] = 0.2

Also regarding the epoch learning rate, I reverted back to the original line of codes. As it was not making any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants