-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 custom dataset #75
Comments
Hi @jwyang
Any idea? |
Hi, @JavHaro , it seems that the training collapsed, According to your output, I find it is weird that fg/bg = (783/241) since the ratio between fg and bg numbers should be not that high if you did not change hyperparameters. So I would suggest that you go back to check whether you training data from you customized data loader is good or not. |
Thanks @jwyang ! Edit: i forgot to mention that i changed batch_size =4. |
Hi @jwyang , Thanks!! |
@JavHaro , Typically, you need to subtract the mean to make the range suitable for the pretrained VGG or ResNet. |
Thanks @jwyang ! I subtract the mean of pascal dataset but maybe i should subtract my dataset's mean. Another issue that i could have is that the number of pixels per object is quite low (aprox 30 pixels of width). Do you think that this could cause the network collapse? |
A related question: If I dont want to use a pretrained network (i.e resnet), can I switch "pretrained=true" to "pretrained=false" in the appropriate place? Will it work? |
Hi, @CodeJjang , yes, it will train from scratch if you set pretrained=False. |
@JavHaro Hi, were you able to successfully train your custom dataset model? |
Hi @vibrantabhi19, |
Hi @jwyang |
@JavHaro Hi, I think I already fixed this bug, did you update your roibatchloader.py? |
Hi @jwyang , no since a month ago or so. i will check it. |
@JavHaro How did you create ImageSet folder for your custom dataset? It has two folders Layout and Main. Did you create files for both? Also in Main folder how do you specify -1 class as you only have one class (I also have one class to detect). Kindly let me know. Thanks |
Hi @jwyang . I meet a similar situation with JavHaro. And I found that the training will be collapsed and all the loss will be nan when fg_rois_per_this_image is 0 in proposal_target_layer. Did you meet this case? |
@Suxin5987THU I am still in a phase of preparing my own dataset in VOC format. Can anyone help me how to structure dataset especially ImageSet folder? Thanks |
Hi @zeehasham I followed the instructions of this post. Answering your question, I created files for both of them by specifying in Main the class name and Layout without specifying it. I really don't know if it's necessary or if it works because I haven't had time to check the training results. As soon as I have time and check that everything is ok I will post a new message with the main modifications that I have had in case it serves as a guide for someone. |
Hi @jwyang, @zeehasham and @Suxin5987THU |
@JavHaro Can you show where is the fix? In what file + what is the fix exactly? |
Hi @JavHaro, I too am facing the same issue, could you please show exactly where to incorporate the fix. @CodeJjangor anybody else, if you know the fix, please let me know. Thanks |
Hello @jwyang @JavHaro I0612 13:01:18.071843 3126 sgd_solver.cpp:106] Iteration 1360, lr = 0.001 and this bbox_transform.py:48: RuntimeWarning: overflow encountered in exp what should be done to get rid of these errors.. |
@JavHaro Can you show where is the fix? In what file + what is the fix exactly? |
Sorry @adamklec, @Karthik-Suresh93 & @1csu , i can't remember exactly the file or the exact fix. It was in the moment of loading annotations. The problem was that if an annotation index is quite close to 0 (in x or y axis), this annotations were transformed into the maximum value (i can't remember when or why). I just did something like this:
If you perform a check like this before using annotations the problem should be fixed. |
Maybe in pascal_voc.py ,there are some code about get bbox coordinates |
There's an overflow when setting faster-rcnn.pytorch/lib/datasets/pascal_voc.py Lines 234 to 237 in 7d106c9
|
@benjmcarr
Thanks alot : ) |
@benjmcarr thanks, it works for me. And we also need to delete the cached gt to create new gt. |
Hi @jwyang,
As i mentioned in a previous post I would like to train a Faster-R-CNN model (vgg16) with my own dataset. I have followed this post based on the code of Ross Girshick but adapting it to your implementation. Now I'm trying to adapt the network model to my dataset but i don't know what should i modify to do it? Do you have any idea that could guide me?
Thanks!!
PS: I know that there is a closed issue regarding this but i posted here just in case you don't follow up closed issues.
The text was updated successfully, but these errors were encountered: