sefibk / KernelGAN

Other
340 stars 77 forks source link

can't run in my MacBook Pro 2017 without NVDIA graphic card #12

Closed Intro1997 closed 4 years ago

Intro1997 commented 4 years ago

When I run your code, I get the following error:

Traceback (most recent call last): File "train.py", line 52, in <module> main() File "train.py", line 34, in main conf = Config().parse(create_params(filename, args)) File "/Users/outro/Downloads/KernelGAN-master/configs.py", line 51, in parse self.set_gpu_device() File "/Users/outro/Downloads/KernelGAN-master/configs.py", line 67, in set_gpu_device torch.cuda.set_device(0) File "/usr/local/lib/python3.7/site-packages/torch/cuda/__init__.py", line 292, in set_device torch._C._cuda_setDevice(device) AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'

I try to use torch.cuda.set_device(-1) and after that, I get the following error:

Traceback (most recent call last): File "train.py", line 52, in <module> main() File "train.py", line 35, in main train(conf) File "train.py", line 11, in train gan = KernelGAN(conf) File "/Users/outro/Downloads/KernelGAN-master/kernelGAN.py", line 21, in __init__ self.G = networks.Generator(conf).cuda() File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 304, in cuda return self._apply(lambda t: t.cuda(device)) File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 201, in _apply module._apply(fn) File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 223, in _apply param_applied = fn(param) File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 304, in <lambda> return self._apply(lambda t: t.cuda(device)) File "/usr/local/lib/python3.7/site-packages/torch/cuda/__init__.py", line 196, in _lazy_init _check_driver() File "/usr/local/lib/python3.7/site-packages/torch/cuda/__init__.py", line 94, in _check_driver raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled

Could you tell me how to solve this error?

sefibk commented 4 years ago

The code does not support running on CPU. You can modify it if necessary but it requires many changes (to all the places I used '.cuda()')

Intro1997 commented 4 years ago

Thank you for your advice!