Skip to content

Fix AssertionError(Torch not compiled with CUDA enabled) on CPU-only device#78

Merged
Zeqiang-Lai merged 1 commit intoOpenGVLab:mainfrom
SnoopyDevelops:main
Jun 5, 2023
Merged

Fix AssertionError(Torch not compiled with CUDA enabled) on CPU-only device#78
Zeqiang-Lai merged 1 commit intoOpenGVLab:mainfrom
SnoopyDevelops:main

Conversation

@SnoopyDevelops
Copy link
Contributor

#51

@ds-nat-j
Copy link

ds-nat-j commented Jun 9, 2023

I think this issue should be still open.
Facing the same error AssertionError: Torch not compiled with CUDA enabled even today after the merging commit 7e19ecf

Facing issue in line:
DragGAN/draggan/stylegan2/inversion.py", line 113, in inverse_image
imgs = torch.stack(imgs, 0).to(device)

Here, device is set to 'cuda' even if the developer has parsed --device cpu like python -m draggan.web --device cpu
An easy fix will be to just pass on the parsed value of cpu to device instead of hard coding it to device = "cuda" like in line 93 of DragGAN/draggan/stylegan2/inversion.py

@Zeqiang-Lai Zeqiang-Lai mentioned this pull request Jun 10, 2023
@Zeqiang-Lai
Copy link
Collaborator

I think this issue should be still open. Facing the same error AssertionError: Torch not compiled with CUDA enabled even today after the merging commit 7e19ecf

Facing issue in line: DragGAN/draggan/stylegan2/inversion.py", line 113, in inverse_image imgs = torch.stack(imgs, 0).to(device)

Here, device is set to 'cuda' even if the developer has parsed --device cpu like python -m draggan.web --device cpu An easy fix will be to just pass on the parsed value of cpu to device instead of hard coding it to device = "cuda" like in line 93 of DragGAN/draggan/stylegan2/inversion.py

Yes, you are right. The inversion could not be finished without GPU practically, so I didn't spend time for making it cpu compatible before. But since so many people facing the issue, I will take some time to fix it later.

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

Successfully merging this pull request may close these issues.

4 participants