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

Loss distill NaN #5

Open
John1231983 opened this issue Aug 11, 2022 · 3 comments
Open

Loss distill NaN #5

John1231983 opened this issue Aug 11, 2022 · 3 comments

Comments

@John1231983
Copy link

I trained the code with --fp16 True and distill loss becomes NaN. Any suggestion to fix it? I am using pytorch 1.12

@xiao-hua-sheng
Copy link
Owner

Not currently supported --fp16 = True

@John1231983
Copy link
Author

John1231983 commented Aug 13, 2022

This is log when I disable fp16

2022-08-13 09:30:53 | INFO     | yolox.core.trainer:280 - epoch: 1/300, iter: 10/171, mem: 4942Mb, iter_time: 0.415s, data_time: 0.002s, total_loss: 290979552.0, iou_loss: 4.3, l1_loss: 0.0, conf_loss: 39.4, cls_loss: 1.6, lr: 6.840e-07, size: 416, ETA: 5:54:54
2022-08-13 09:30:58 | INFO     | yolox.core.trainer:280 - epoch: 1/300, iter: 20/171, mem: 4942Mb, iter_time: 0.468s, data_time: 0.004s, total_loss: 1984544256.0, iou_loss: 4.1, l1_loss: 0.0, conf_loss: 15.3, cls_loss: 2.0, lr: 2.736e-06, size: 352, ETA: 6:17:12
2022-08-13 09:31:01 | INFO     | yolox.core.trainer:280 - epoch: 1/300, iter: 30/171, mem: 4942Mb, iter_time: 0.358s, data_time: 0.005s, total_loss: 223795872.0, iou_loss: 4.5, l1_loss: 0.0, conf_loss: 28.7, cls_loss: 1.2, lr: 6.156e-06, size: 352, ETA: 5:53:21
2022-08-13 09:31:09 | INFO     | yolox.core.trainer:280 - epoch: 1/300, iter: 40/171, mem: 18032Mb, iter_time: 0.819s, data_time: 0.003s, total_loss: 1283537536.0, iou_loss: 4.5, l1_loss: 0.0, conf_loss: 46.6, cls_loss: 1.4, lr: 1.094e-05, size: 576, ETA: 7:19:58

Note that, I commented the line

dloss = torch.clamp(dloss,0,1000)

@John1231983
Copy link
Author

@xiao-hua-sheng could you please give some comment?

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