OpenGVLab / DragGAN

Unofficial Implementation of DragGAN - "Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold" (DragGAN 全功能实现,在线Demo,本地部署试用,代码、模型已全部开源,支持Windows, macOS, Linux)
5k stars 489 forks source link

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

Closed SnoopyDevelops closed 1 year ago

SnoopyDevelops commented 1 year ago

https://github.com/Zeqiang-Lai/DragGAN/issues/51

ds-nat-j commented 1 year ago

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 commented 1 year ago

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.