Error with Fix for: Expected all tensors to be on the same device #1700
Closed
rorshopping
started this conversation in
General
Replies: 1 comment
-
This could be one solution but the fix has already been solved in the latest version of Fooocus, see #1671 (comment). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I wanted to mention a fix that made Fooocus work for me:
I had the following error when starting run.bat:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
Adding this snippet:
"# Move the model to the appropriate device (GPU or CPU)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)"
to the beginning of:
"\Fooocus_win64_2-1-831\python_embeded\lib\site-packages\transformers\models\gpt2\modeling_gpt2.py"
fixed the issue for me.
Best regards
Beta Was this translation helpful? Give feedback.
All reactions