-
Notifications
You must be signed in to change notification settings - Fork 213
How to run with cpu? Actually CUDA is needed anyway? #16
Comments
it seems that even though i added the option "--gpu_ids -1", the self.device still have value cuda:0 self.device = torch.device("cuda:0" if self.opt.gpu_ids!=-1 else "cpu") why |
And I skipped this line, force self.device to be "cpu", but the problem is still there THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1535491974311/work/aten/src/THC/THCGeneral.cpp line=74 error=35 : CUDA driver version is insufficient for CUDA runtime version |
I've updated the repo now. You could run the code on CPU via the following command: |
Hi,I turn to run the code on Linux. But I don't have a computer with NVDIA device, so I tried to run the code only in cpu, like this command:
./python ~/ganomaly/train.py --dataset cifar10 --niter 100 --anomaly_class cat --gpu_ids -1 --ngpu 0
But it turns out that the code needs CUDA device anyway... Are there any options I missed? Thx~!
The running result:
~/anaconda3/bin$ ./python ~/ganomaly/train.py --dataset cifar10 --niter 100 --anomaly_class cat --gpu_ids -1 --ngpu 0 /home/foo/anaconda3/lib/python3.6/site-packages/torchvision-0.2.1-py3.6.egg/torchvision/transforms/transforms.py:188: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead. Files already downloaded and verified Files already downloaded and verified THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1535491974311/work/aten/src/THC/THCGeneral.cpp line=74 error=35 : CUDA driver version is insufficient for CUDA runtime version Traceback (most recent call last): File "/home/foo/ganomaly/train.py", line 39, in <module> model = Ganomaly(opt, dataloader) File "/home/foo/ganomaly/lib/model.py", line 71, in __init__ self.netg = NetG(self.opt).to(self.device) File "/home/foo/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 379, in to return self._apply(convert) File "/home/foo/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply module._apply(fn) File "/home/foo/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply module._apply(fn) File "/home/foo/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply module._apply(fn) File "/home/foo/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 191, in _apply param.data = fn(param.data) File "/home/foo/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 377, in convert return t.to(device, dtype if t.is_floating_point() else None, non_blocking) RuntimeError: cuda runtime error (35) : CUDA driver version is insufficient for CUDA runtime version at /opt/conda/conda-bld/pytorch_1535491974311/work/aten/src/THC/THCGeneral.cpp:74
The text was updated successfully, but these errors were encountered: