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 value in the loss. #1

Open
mountains-high opened this issue Jan 24, 2024 · 1 comment
Open

NaN value in the loss. #1

mountains-high opened this issue Jan 24, 2024 · 1 comment

Comments

@mountains-high
Copy link

Hi, thanks for the fine work.
I didn't change any hyperparameters and ran the code as is. I'm getting NaN in the loss. Could you please help me solve this issue?
Thanks.
Screenshot 2024-01-23 at 1 08 26 AM

@hchoi71
Copy link
Owner

hchoi71 commented Jan 24, 2024

Hello thanks for brining up this issue.

I've not seen this when running the code, but I appreciate you finding it. I suspect that there might be a factor contributing to training instability, especially when 'stds' and 'stdt' are very small..

Unfortunately, I'm not able to see&fix it immediately due to other ongoing tasks, I will update it once I complete current workload. In the meantime, could you try it with clipping stds and stdt in MIXSTD.py if this works?

stdt = torch.clamp(torch.std(logit_t, dim=-1, keepdim=True), min=1e-4)
stds = torch.clamp(torch.std(logit_s, dim=-1, keepdim=True), min=1e-4)

Also, I was wondering what model's configuration causes this 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

2 participants