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

training and validation loss nan #26

Closed
Barfknecht opened this issue Aug 9, 2017 · 9 comments
Closed

training and validation loss nan #26

Barfknecht opened this issue Aug 9, 2017 · 9 comments

Comments

@Barfknecht
Copy link

First of all I just want to thank you for the great work.
I am having an issue during training, my loss and val_loss is nan, however I am still getting values for accuracy and val_acc. I am training on the PASCAL_VOC 2012 dataset with the segmentation class pngs.
rsz_screenshot_from_2017-08-09_17-24-13

keras 1.2.1 & 2.0.6
tensorflow-gpu 1.2.1
python 3.6.1

@nicolov
Copy link
Owner

nicolov commented Aug 11, 2017 via email

@Barfknecht
Copy link
Author

Yes, the dataset was corrupt somehow. Just re-downloaded and it is fine.

@dimaxano
Copy link

@Barfknecht Could you, please, tell what exactly was wrong with your dataset, because I have this problem on my own dataset. But it doesn't look corrupted

@Barfknecht
Copy link
Author

@dimaxano Can you give an example of an image?
The issue with mine was that the pixel values of the masks were not valid, so instead of them indicating the class, it had corrupted it and changed it to random ASCII characters.

@dimaxano
Copy link

dimaxano commented Oct 18, 2017

not_det_r_86c32981-6230-4f84-b4db-7429a1b37050_5216350389
not_det_r_86c32981-6230-4f84-b4db-7429a1b37050_5216350389
Here is one of my image

@Barfknecht
Copy link
Author

@dimaxano Well I can see your problem. So the issue is that the image mask has not been correctly formatted. So if you look in the benchmark_RELEASE/dataset/pngs folder you will see how the masks have been formatted. For example, 2008_000026.png is a mask of a person. That is class 15 of this altered pascal_voc dataset. When you open the png as a matrix, every pixel where the person is located has a pixel value of 15. So the input image is grayscale where the pixel values represent the class associated with it. So I have added one more class to this set, namely tyres. I have then made this my 21st class and when I created the mask, every pixel which is a tyre I set that pixel value to 21.

I hope this helps

@dimaxano
Copy link

dimaxano commented Oct 18, 2017

@Barfknecht Thanks for advice! Now it works

@Barfknecht
Copy link
Author

Barfknecht commented Oct 18, 2017

@dimaxano No problem, can you give me some advice on how you trained on your own dataset?

@dimaxano
Copy link

@Barfknecht For now, I have some troubles with predicting (#33), but training was quite easy (except this problem with labels ). It is more important to prepare data in a right way

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

3 participants