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

hello,i have a question! #20

Open
xiaolongxia520 opened this issue Jun 11, 2020 · 7 comments
Open

hello,i have a question! #20

xiaolongxia520 opened this issue Jun 11, 2020 · 7 comments

Comments

@xiaolongxia520
Copy link

I used your training parameters, loss=nan?I checked and said to use dynamic learning rate. Have you used it?

@kritikaksu
Copy link

Hey..The same problem was with me then i realized that my input image size was not 112x112. when i have re-scaled them to 112x112 then Nan Values have been gone..

@GranMin
Copy link

GranMin commented Jul 19, 2021

hello,My image size is 96x96, and I changed the input of the model, just as shown blow. But my loss is still nan. Do you have any idea about it?
1

@Androsimus
Copy link

@GranMin
Hi!
In a dataset.py size of input image is hardcoded in function _transform_images. Maybe this is the reason of nans.

@Androsimus
Copy link

@GranMin besides, if you use script convert_train_binary_tfrecord.py for data preprocessing, you must enforce all dir names of your N classes are strictly within interval [0,...,N-1], because dir names will be further used as labels in Softmax loss.

@GranMin
Copy link

GranMin commented Aug 6, 2021

@Androsimus thankyou, I find my problem that I labeled my dataset by [1,...,N] rather than [0,...,N-1]. So I got nan. I correct it and then it runs well.
By the way, when I changed optimizer to Adam, model resnet50 sometimes achieve accuracy of 0.9, but sometimes sticks in 0.3, do you have any idea about it?

@Androsimus
Copy link

@GranMin if you use identical hyperparameters and datasets, then I can hardly imagine appropriate reasons.
But if you use different learning rates for example or something else, then I can try to explain this.

@GranMin
Copy link

GranMin commented Aug 9, 2021

@Androsimus thanks.I had some problem with the understanding of tf.optimizers, I changed the hyperparameters as somebody said, and it works. Best wishes!

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

4 participants