-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! #27
Comments
This error raised because you ran this project on GPU but some tensor ran on CPU. |
I know what is the problem I want to found a solution. |
You can try this code. |
I have tried the code above but i also does not work !!! |
I fixed this the problem |
Thank you @anasAloklah. Your solution worked for me! |
Your solution worked for me! too |
File "E:\Transformer-master\Batch.py", line 26, in create_masks
trg_mask = trg_mask & np_mask
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
In the past, he worked with me without problems, but after I format the device and download the programs and offices again,
this problem happened to me and I do not know the reason.
The text was updated successfully, but these errors were encountered: