odegeasslbc / FastGAN-pytorch

Official implementation of the paper "Towards Faster and Stabilized GAN Training for High-fidelity Few-shot Image Synthesis" in ICLR 2021
GNU General Public License v3.0
600 stars 100 forks source link

cpu support? #20

Closed CuteBlack99 closed 3 years ago

CuteBlack99 commented 3 years ago

Whenever I'm trying to run this, I'm getting the error

Traceback (most recent call last):
  File "C:\Users\SAMSUNG\FastGAN-pytorch\train.py", line 18, in <module>
    percept = lpips.PerceptualLoss(model='net-lin', net='vgg', use_gpu=True)
  File "C:\Users\SAMSUNG\FastGAN-pytorch\lpips\__init__.py", line 22, in __init__
    self.model.initialize(model=model, net=net, use_gpu=use_gpu, colorspace=colorspace, spatial=self.spatial, gpu_ids=gpu_ids)
  File "C:\Users\SAMSUNG\FastGAN-pytorch\lpips\dist_model.py", line 99, in initialize
    self.net.to(gpu_ids[0])
  File "C:\Users\SAMSUNG\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 673, in to
    return self._apply(convert)
  File "C:\Users\SAMSUNG\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 387, in _apply
    module._apply(fn)
  File "C:\Users\SAMSUNG\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 430, in _apply
    self._buffers[key] = fn(buf)
  File "C:\Users\SAMSUNG\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 671, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
  File "C:\Users\SAMSUNG\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\cuda\__init__.py", line 170, in _lazy_init
    torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

which, I think, is because I don't have a NVIDIA graphic card.

So it does not support CPU only runs? I mean this seems to be reasonably lighter than other styleGAN related stuffs.

odegeasslbc commented 3 years ago

Hi, Sorry but I don't think it is feasible to run this model on CPU. So I do not have cpu support. It is lighter than Stylegan with a magnitude of 10, but CPU is easily 100 times slower than GPU, so it can still take weeks to months to train the model on CPU.