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

梯度回传时出现nan, #143

Open
li1changxing opened this issue Jul 5, 2024 · 0 comments
Open

梯度回传时出现nan, #143

li1changxing opened this issue Jul 5, 2024 · 0 comments

Comments

@li1changxing
Copy link

https://github.com/huawei-noah/Efficient-Computing/blob/master/Data-Efficient-Model-Compression/DAFL/DAFL-train.py#L179

loss_information_entropy = (softmax_o_T * torch.log10(softmax_o_T)).sum()

RuntimeError: Function 'XlogyBackward0' returned nan values in its 1th output.

这里是不是会出现当softmax后概率过小或者为0的情况时,会出现nan的情况,当时你遇到过吗,如果遇到过,当时是怎么解决这个问题的。

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