mkocabas / EpipolarPose

Self-Supervised Learning of 3D Human Pose using Multi-view Geometry (CVPR2019)
Other
594 stars 97 forks source link

how to run using CPU not GPUs #16

Closed qiaopTDUN closed 5 years ago

qiaopTDUN commented 5 years ago

I followed the readme to config the environment. When I tried to run the demo.ipynb, I encounted the following errors. It seems that the demo runs using GPUs only. However, I have no access to GPU right now. How can I run the demo using CPU instead of GPUs.

`--------------------------------------------------------------------------- AssertionError Traceback (most recent call last)

in 1 model = models.pose3d_resnet.get_pose_net(config, is_train=False) 2 gpus = [int(i) for i in config.GPUS.split(',')] ----> 3 model = torch.nn.DataParallel(model, device_ids=gpus).cuda() 4 print('Created model...') 5 ~/.local/lib/python3.5/site-packages/torch/nn/modules/module.py in cuda(self, device) 263 Module: self 264 """ --> 265 return self._apply(lambda t: t.cuda(device)) 266 267 def cpu(self): ~/.local/lib/python3.5/site-packages/torch/nn/modules/module.py in _apply(self, fn) 191 def _apply(self, fn): 192 for module in self.children(): --> 193 module._apply(fn) 194 195 for param in self._parameters.values(): ~/.local/lib/python3.5/site-packages/torch/nn/modules/module.py in _apply(self, fn) 191 def _apply(self, fn): 192 for module in self.children(): --> 193 module._apply(fn) 194 195 for param in self._parameters.values(): ~/.local/lib/python3.5/site-packages/torch/nn/modules/module.py in _apply(self, fn) 197 # Tensors stored in modules are graph leaves, and we don't 198 # want to create copy nodes, so we have to unpack the data. --> 199 param.data = fn(param.data) 200 if param._grad is not None: 201 param._grad.data = fn(param._grad.data) ~/.local/lib/python3.5/site-packages/torch/nn/modules/module.py in (t) 263 Module: self 264 """ --> 265 return self._apply(lambda t: t.cuda(device)) 266 267 def cpu(self): ~/.local/lib/python3.5/site-packages/torch/cuda/__init__.py in _lazy_init() 160 raise RuntimeError( 161 "Cannot re-initialize CUDA in forked subprocess. " + msg) --> 162 _check_driver() 163 torch._C._cuda_init() 164 _cudart = _load_cudart() ~/.local/lib/python3.5/site-packages/torch/cuda/__init__.py in _check_driver() 80 Found no NVIDIA driver on your system. Please check that you 81 have an NVIDIA GPU and installed a driver from ---> 82 http://www.nvidia.com/Download/index.aspx""") 83 else: 84 # TODO: directly link to the alternative bin that needs install AssertionError: 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`
mkocabas commented 5 years ago

Hi @qiaopTDUN,

This issue https://github.com/mkocabas/EpipolarPose/issues/11 should help.

qiaopTDUN commented 5 years ago

Hi @qiaopTDUN,

This issue #11 should help.

Thanks. Following #11, the problem encountered is fixed.