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

how to resolve loss=-inf #10

Open
YHaooo-4508 opened this issue Mar 13, 2025 · 0 comments
Open

how to resolve loss=-inf #10

YHaooo-4508 opened this issue Mar 13, 2025 · 0 comments

Comments

@YHaooo-4508
Copy link

I tried to add variance prediction in my own loss, so I tried to reproduce step by step.
so, at the first step, i just added the var prediction in my loss function calculation(without nf_loss).

`loss_body_pose =((torch.log(body_pose_sigma/amp) + torch.abs(body_pose_gt - body_pose_pred)) / (math.sqrt(2) * body_pose_sigma + 1e-9))

loss_body_pose = loss_body_pose[has_gt==1].sum()

loss_all = loss_keypoints_3d + loss_keypoints_2d + loss_body_pose
`
In the first 200+ iterations,the loss_all>0 and it's was normally decreasing. Then suddenly it changed from 50 to a negative number, and became smaller and smaller until it became -inf.

I would like to know if this issue has also occurred in your experiment and how to solve it.

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

1 participant