zhengqili / unsupervised-learning-intrinsic-images

Implementation of the intrinsic image decomposition algorithm described in "Learning Intrinsic Image Decomposition from Watching the World, Z. Li and N. Snavely, CVPR 2018"
MIT License
107 stars 24 forks source link

Cuda RuntimeError #4

Open ava-YangL opened 6 years ago

ava-YangL commented 6 years ago
  File "/data/yl/code/3D/IntrinsicImage/unsupervised_learning_intrinsic_images/models/networks.py", line 869, in forward
    prediction_S, prediction_R, rgb_s = self.model(input_)
  File "/data/yl/software/anaconda3/envs/Myenv2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/data/yl/code/3D/IntrinsicImage/unsupervised_learning_intrinsic_images/models/networks.py", line 758, in forward
    return nn.parallel.data_parallel(self.model, input, self.gpu_ids)
  File "/data/yl/software/anaconda3/envs/Myenv2/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py", line 101, in data_parallel
    inputs, module_kwargs = scatter_kwargs(inputs, module_kwargs, device_ids, dim)
  File "/data/yl/software/anaconda3/envs/Myenv2/lib/python2.7/site-packages/torch/nn/parallel/scatter_gather.py", line 30, in scatter_kwargs
    inputs = scatter(inputs, target_gpus, dim)
  File "/data/yl/software/anaconda3/envs/Myenv2/lib/python2.7/site-packages/torch/nn/parallel/scatter_gather.py", line 25, in scatter
    return scatter_map(inputs)
  File "/data/yl/software/anaconda3/envs/Myenv2/lib/python2.7/site-packages/torch/nn/parallel/scatter_gather.py", line 18, in scatter_map
    return tuple(zip(*map(scatter_map, obj)))
  File "/data/yl/software/anaconda3/envs/Myenv2/lib/python2.7/site-packages/torch/nn/parallel/scatter_gather.py", line 15, in scatter_map
    return Scatter(target_gpus, dim=dim)(obj)
  File "/data/yl/software/anaconda3/envs/Myenv2/lib/python2.7/site-packages/torch/nn/parallel/_functions.py", line 59, in forward
    outputs = comm.scatter(input, self.target_gpus, self.chunk_sizes, self.dim, streams)
  File "/data/yl/software/anaconda3/envs/Myenv2/lib/python2.7/site-packages/torch/cuda/comm.py", line 162, in scatter
    with torch.cuda.device(device), torch.cuda.stream(stream):
  File "/data/yl/software/anaconda3/envs/Myenv2/lib/python2.7/site-packages/torch/cuda/__init__.py", line 127, in __enter__
    torch._C._cuda_setDevice(self.idx)
RuntimeError: cuda runtime error (10) : invalid device ordinal at torch/csrc/cuda/Module.cpp:84

I get the error when use the pretrained model in“http://landmark.cs.cornell.edu/projects/bigtime/paper_final_net_G.pth

Could you give me any advices,Thank you very much

zhengqili commented 6 years ago

You might need to change the number of GPUs to be used in base_options.py