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

A question about "Loss is nan" #7

Closed
yafangna opened this issue Oct 11, 2022 · 1 comment
Closed

A question about "Loss is nan" #7

yafangna opened this issue Oct 11, 2022 · 1 comment

Comments

@yafangna
Copy link

Is there any interface in the source code that would cause the loss is nan problem sometimes and the correct operation sometimes?

@vtddggg
Copy link
Owner

vtddggg commented Oct 12, 2022

"loss is nan" is a problem for original ViT models when amp is turned on. Check here for more details.

Afterwards, many techniques are proposed to solve this problem, e.g., LayerScale. You can refer these techniques for preventing training loss to nan.

@vtddggg vtddggg closed this as completed May 4, 2023
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