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 nan bug #14

Open
wade0604 opened this issue Apr 2, 2024 · 0 comments
Open

loss nan bug #14

wade0604 opened this issue Apr 2, 2024 · 0 comments

Comments

@wade0604
Copy link

wade0604 commented Apr 2, 2024

loss = loss.sum([1,2,3,4])/masks.sum([1,2,3,4])
if masks.sum([1,2,3,4]) contains 0, then the loss will be NaN
so i simply change the upper code to loss = loss.sum([1,2,3,4])/(masks.sum([1,2,3,4])+1e-6), Is this appropriate?

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