xingyizhou / pytorch-pose-hg-3d

PyTorch implementation for 3D human pose estimation
GNU General Public License v3.0
615 stars 141 forks source link

Error Demo CPU, not CUDA #54

Closed NguyenDangBinh closed 5 years ago

NguyenDangBinh commented 5 years ago

I use CPU, not GPU, not CUDA. I use Anaconda, Spider to build demo.py. I had a error:

File "C:\Users\user\Anaconda3\envs\tensorflow\lib\site-packages\torch\serialization.py", line 78, in validate_cuda_device raise RuntimeError('Attempting to deserialize object on a CUDA '

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location='cpu' to map your storages to the CPU.

Can you help me?

xingyizhou commented 5 years ago

Hi, Thanks for the report! The current version should work on CPU. https://github.com/xingyizhou/pytorch-pose-hg-3d/commit/b8afd1027f5e846e5923ac8deefafc76869ed788#diff-30a30f8b61024bfe24b090332ccda819R20 .

NguyenDangBinh commented 5 years ago

dear, thank you for the report but i still have the error like that I run demo.py 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 You help me.

NguyenDangBinh commented 5 years ago

runfile('D:/pytorch-pose-hg-3d-master/src/demo.py', wdir='D:/pytorch-pose-hg-3d-master/src') Reloaded modules: models.msra_resnet, utils.debugger, utils, model, utils.eval, models, opts, utils.image, _init_paths heads {'hm': 16} => using msra resnet 'msra_50' => loading pretrained model https://download.pytorch.org/models/resnet50-19c8e357.pth loaded: D:/pytorch-pose-hg-3d-master/models/fusion_3d_var.pth, epoch: 10 Traceback (most recent call last):

File "", line 1, in runfile('D:/pytorch-pose-hg-3d-master/src/demo.py', wdir='D:/pytorch-pose-hg-3d-master/src')

File "C:\Users\user\Anaconda3\envs\tensorflow\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 668, in runfile execfile(filename, namespace)

File "C:\Users\user\Anaconda3\envs\tensorflow\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/pytorch-pose-hg-3d-master/src/demo.py", line 81, in main(opt)

File "D:/pytorch-pose-hg-3d-master/src/demo.py", line 62, in main model = model.to(opt.device)

File "C:\Users\user\Anaconda3\envs\tensorflow\lib\site-packages\torch\nn\modules\module.py", line 381, in to return self._apply(convert)

File "C:\Users\user\Anaconda3\envs\tensorflow\lib\site-packages\torch\nn\modules\module.py", line 187, in _apply module._apply(fn)

File "C:\Users\user\Anaconda3\envs\tensorflow\lib\site-packages\torch\nn\modules\module.py", line 193, in _apply param.data = fn(param.data)

File "C:\Users\user\Anaconda3\envs\tensorflow\lib\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 "C:\Users\user\Anaconda3\envs\tensorflow\lib\site-packages\torch\cuda__init__.py", line 161, in _lazy_init _check_driver()

File "C:\Users\user\Anaconda3\envs\tensorflow\lib\site-packages\torch\cuda__init__.py", line 82, in _check_driver http://www.nvidia.com/Download/index.aspx""")

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

xingyizhou commented 5 years ago

Hi, What is your commend to run the demo? You should add --gpus -1 for cpu mode.

NguyenDangBinh commented 5 years ago

I run demo.py on Spider( Anaconda). I dont know how to add --gpus -1?

NguyenDangBinh commented 5 years ago

image

NguyenDangBinh commented 5 years ago

I run in Anaconda Pompt below image

Peter654q commented 5 years ago

Hi, Maybe you can try the command like: "python3 src/demo.py --demo images/h36m_1214.png --gpu -1 --load_model models/fusion_3d_var.pth"

NguyenDangBinh commented 5 years ago

dear, What is this? image

NguyenDangBinh commented 5 years ago

dear, If you have a free time, can you help me with teamviewer software?

xingyizhou commented 5 years ago

Hi, It seems that the indent of your screen-shot has been changed from my code. Can you try deleting two spaces for line 69-72 and adding one space to line 74-76? I don't know how to use teamviewer.

NguyenIvan commented 5 years ago

Hi Binh, I am also into this Pose Recognition Repo. I can run it with 0.4 and CPU. If you are in Ho Chi Minh I can help you out. Email me at nguyen.le@qhoach.com. Nguyen

NguyenIvan commented 5 years ago

Chào bạn NguyenDangBinh, Tôi đã nghiên cứu công nghệ này 5 năm để ứng dụng vào võ thuật nên không lạ gì nó. Nếu bạn tìm sự giúp đỡ tôi có thể giúp bạn. Bạn đang ở Tp nào? Nguyên.

NguyenDangBinh commented 5 years ago

chào anh Nguyên, Em ở Bình Thạnh, Em đang nghiên cứu cái này cho ứng dụng chăm sóc người già, em làm đề cương luận văn thạc sỷ, trước đó em đã đi làm vài năm rồi. Nền của em là Lập trình nhúng và tự động hóa. Em đang rất cần sự giúp đỡ từ anh, rất vui được quen biết anh. Bình

NguyenDangBinh commented 5 years ago

Hi, It seems that the indent of your screen-shot has been changed from my code. Can you try deleting two spaces for line 69-72 and adding one space to line 74-76? I don't know how to use teamviewer. Dear, Teamviewer is a sorfware which can connect 2 laptop each other. I have error about UnboundLocalError that you can see at image below: image How to fix it

NguyenDangBinh commented 5 years ago

I fixed it