-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Trainer RuntimeError CUDA error #19862
Comments
This looks linked to your particular setup. Can you add a print of |
thanks for the prompt reply and sorry for missing the
Env:
(i`ve also tried with other PyTorch & transformers versions) |
i hope its ok that i putting a link to different ML library (in case its not - i`ll delete it) |
It doesn't look exactly similar in the sense that it is in an environment without a GPU, whereas yours shows one. Unless you are not executing the script within the exact same env as the results of the commands passed above of course. |
System Info
Versions
i`ve tried using
nvidia-smi
NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7
Thanks!
Who can help?
@sgugger
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Actual Error:
Class:
transformers/trainer.py
Failing at:
tr_loss = torch.tensor(0.0).to(args.device)
Returns:
RuntimeError: CUDA error: invalid argument
Code
I am following several examples and getting the same above error and the same line.
As a reference you can reproduce it according to this code sample
The exact same error occur with other huggingface training examples.
Also tried
tr_loss = torch.tensor(0.0).to(args.device)
as a standalone its working finetransformers/trainer.py
torch.cuda.is_available()
torch.tensor(0.0)
works fine, only when adding.to(device)
its failingExpected behavior
No errors at
torch.tensor(0.0).to(device)
The text was updated successfully, but these errors were encountered: