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

NaN losses #8

Open
DandiC opened this issue Jul 2, 2019 · 1 comment
Open

NaN losses #8

DandiC opened this issue Jul 2, 2019 · 1 comment

Comments

@DandiC
Copy link

DandiC commented Jul 2, 2019

I'm training the model with different datasets and image sizes. I have noticed that if I use images larger than 64x64, all the losses become NaN after a certain point. It seems like it happens earlier as the image size increase (for instance, it happens after 77 epochs with 128x128 images and after 3 epochs with 1024x1024 images). Do you happen to know why this is happening and do you have any advice to address it?

Thanks!

@FIlipHand
Copy link

I had the same problem multiple times on my own. It's happening because of something known as gradient explosion, which means that loss values are to big and they are overflowing therefore you are getting nones. There are some things you can try to apply and they are written here: https://machinelearningmastery.com/exploding-gradients-in-neural-networks/

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

2 participants