Traceback (most recent call last):
File "test.py", line 35, in
model = create_model(opt)
File "/home/zzh/桌面/RankSRGAN/codes/models/init.py", line 19, in create_model
m = M(opt)
File "/home/zzh/桌面/RankSRGAN/codes/models/SR_model.py", line 26, in init
self.netG = networks.define_G(opt).to(self.device)
File "/home/zzh/anaconda3/envs/py13/lib/python3.6/site-packages/torch/nn/modules/module.py", line 381, in to
return self._apply(convert)
File "/home/zzh/anaconda3/envs/py13/lib/python3.6/site-packages/torch/nn/modules/module.py", line 187, in _apply
module._apply(fn)
File "/home/zzh/anaconda3/envs/py13/lib/python3.6/site-packages/torch/nn/modules/module.py", line 193, in _apply
param.data = fn(param.data)
File "/home/zzh/anaconda3/envs/py13/lib/python3.6/site-packages/torch/nn/modules/module.py", line 379, in convert
return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
File "/home/zzh/anaconda3/envs/py13/lib/python3.6/site-packages/torch/cuda/init.py", line 162, in _lazy_init
torch._C._cuda_init()
RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /opt/conda/conda-bld/pytorch_1544174967633/work/aten/src/THC/THCGeneral.cpp:51
config 里面有一个设置GPUID的,他默认是用三号显卡,如果你机器少于3块卡,就会报这个错误。