Skip to content

how to resolve loss=-inf #10

@YHaooo-4508

Description

@YHaooo-4508

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions