lucidrains / lightweight-gan

Implementation of 'lightweight' GAN, proposed in ICLR 2021, in Pytorch. High resolution image generations that can be trained within a day or two
MIT License
1.62k stars 220 forks source link

cpu training possible? #104

Open jeremy-rutman opened 2 years ago

jeremy-rutman commented 2 years ago

I have some cloud servers with idle cpu , is it possible to run this without gpu? I don't see any such params in cli.py. There's an assert for gpu availability but its not clear to me how vital that is down the road.

tristanbay commented 2 years ago

Considering that the line AssertionError: You need to have an Nvidia GPU with CUDA installed. popped up in PowerShell for me after I tried to run a command, I'd say that you can't, unless there's a working fork of this that someone made that does. Otherwise, contact the dev directly and/or wait.

gigaturbo commented 2 years ago

Changing device("gpu") to device("cpu") and .cuda(...) to .cpu() should work. Also you can remove the asserts related to GPU.

See https://github.com/gigaturbo/lightweight-gan-cpu.git

GTP95 commented 1 year ago

Changing device("gpu") to device("cpu") and .cuda(...) to .cpu() should work. Also you can remove the asserts related to GPU.

See https://github.com/gigaturbo/lightweight-gan-cpu.git

Hello @gigaturbo, I tried your fork, but upon executing it I get the following error:

$ python lightweight_gan/lightweight_gan.py --data ../filtered_dataset --image-size 1024
Traceback (most recent call last):
  File "lightweight_gan/lightweight_gan.py", line 27, in <module>
    from lightweight_gan.diff_augment import DiffAugment
  File "/home/giacomo/lightweight-gan-cpu/lightweight_gan/lightweight_gan.py", line 27, in <module>
    from lightweight_gan.diff_augment import DiffAugment
ModuleNotFoundError: No module named 'lightweight_gan.diff_augment'; 'lightweight_gan' is not a package

Executing $ pip install lightweight-gan did not solve the problem. What am I doing wrong? Thank you for your help,

GTP