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

AssertionError: No inf checks were recorded for this optimizer. #8

Open
Christian-lyc opened this issue Jun 24, 2023 · 1 comment
Open

Comments

@Christian-lyc
Copy link

Hi, thank you so much for your code.
I try to use the pretrained model fine-tuning on the other dataset. But I'm facing a problem.
Do you have some idea about it? The error is listed below, thank you in advance. : )

Traceback (most recent call last):
File "main.py", line 284, in
main()
File "main.py", line 278, in main
train(args)
File "main.py", line 148, in train
amp_scale.step(optimizer)
File "/export/home/yliu/.local/lib/python3.8/site-packages/torch/cuda/amp/grad_scaler.py", line 372, in step
assert len(optimizer_state["found_inf_per_device"]) > 0, "No inf checks were recorded for this optimizer."
AssertionError: No inf checks were recorded for this optimizer.

@jahongir7174
Copy link
Owner

Hello @Christian-lyc

I tested the code on nvcr.io/nvidia/pytorch:22.08-py3 container with torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
Please check with different torch versions such as torch==1.13.1

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