-
Notifications
You must be signed in to change notification settings - Fork 249
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
Loss is coming nan #52
Comments
both loc_loss and cls_loss are coming nan can u suggest the solution |
the condition may be caused by the size of anchors that anchors'size can't match your detected objects |
I also meet this problem...... |
|
I suppose u can print the number of positive example and u can adjust the ratios of the anchor according the number |
did you solved this problem? |
Who have such problem? May someone recommend the solution? loc_loss: 0.088 | cls_loss: 540.022 | Train_loss: 540.11029 | avg_loss: 607.00891 loc_loss: 0.081 | cls_loss: 589.325 | Train_loss: 589.40613 | avg_loss: 601.14132 loc_loss: 0.081 | cls_loss: 418.840 | Train_loss: 418.92139 | avg_loss: 555.58633 loc_loss: 0.083 | cls_loss: 268.827 | Train_loss: 268.90982 | avg_loss: 498.25103 loc_loss: 0.086 | cls_loss: 211.607 | Train_loss: 211.69376 | avg_loss: 450.49149 loc_loss: 0.106 | cls_loss: 71.394 | Train_loss: 71.49988 | avg_loss: 396.34983 loc_loss: 0.075 | cls_loss: 28.076 | Train_loss: 28.15103 | avg_loss: 350.32498 loc_loss: 0.088 | cls_loss: 19.801 | Train_loss: 19.88938 | avg_loss: 313.60991 loc_loss: 0.086 | cls_loss: 12.623 | Train_loss: 12.70911 | avg_loss: 283.51983 loc_loss: 0.092 | cls_loss: inf | Train_loss: inf | avg_loss: inf loc_loss: nan | cls_loss: nan | Train_loss: nan | avg_loss: nan loc_loss: nan | cls_loss: nan | Train_loss: nan | avg_loss: nan` |
Problem was solved.
|
Thanks, It is worked. But can you tell me which statement did you change? |
Where did you get ckpt.pth and params.pth? please help me @heartInsert ,thank you |
I don't have pretrained model, I trained the code myself in voc dataset@Imagery007 |
Thanks.I didn't understand before,Actually, net.pth can be trained without ckpt.pth and params.pth. @heartInsert Thanks again. |
@Imagery007 Do you predict a real picture and draw bboxes in it ? |
@heartInsert Yes, I can't run test.py.I still don't know how to solve it. RuntimeError: Error(s) in loading state_dict for RetinaNet: |
@heartInsert I read the code carefully and successfully ran test.py. I found that test.py was only used to draw the filtered anchor and could not make predictions well. |
@miramind Hello, I want to know the meaning of t in the 43rd line of loss.py. Hope to get your reply.Thanks. |
The effective reason the this line just before the print statement num_pos = max(1.0, num_pos.item()) It makes num_pos a floating point number, this makes sure the loc_loss.item()/num_pos is a floating point result as well. |
In my experiment (custom data and VOC),I found the classification loss may be Nan and the reason is num_pos may be 0. |
I have the same problem as you,can you tell me how to slove it |
Hi there,,any luck with this? I'm having the same trouble and would love to know how to solve it. |
No description provided.
The text was updated successfully, but these errors were encountered: