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 problem #7

Closed
xubangwu opened this issue May 9, 2022 · 2 comments
Closed

loss problem #7

xubangwu opened this issue May 9, 2022 · 2 comments

Comments

@xubangwu
Copy link

xubangwu commented May 9, 2022

Hello, if the number of instances in one batch is zero, the smooth L1 loss(Linit, Lcoarse, Liter) will be 'nan'. How can I address this problem?

@zhang-tao-whu
Copy link
Owner

Sorry for the late answer, I was very busy some time ago so I didn't come to answer the question.
You can add a decision to change the way the loss is calculated when the number of instances is 0.
For example:

if len(pred_polys) == 0:
    loss = torch.sum(pred_polys)
else:
    loss = smooth_l1(pred_polys, target_polys) 

@zhang-tao-whu
Copy link
Owner

I fixed this bugs.

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