You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all: thanks for your amazing work! I would like to use OpenPose, but can't run Caffe in my current setup/environment. This repo is a life-saver.
Now to the point: I got the following error when running the demo.py: TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
I fixed this by changing the line in python/hand.py: output = self.model(data).numpy()
to: output = self.model(data).cpu().numpy()
As numpy can't work on stuff that is still on the GPU.. I'm not sure if this needs to be changed in the repo and if this is the best solution for this error? Thanks.
My environment specs are the following:
OS: CentOS Linux release 7.5.1804
CUDA version: 8.0
cuDNN version: 7.0.5
Torch version: 0.4.1
Python version: Python 3.6.6
GPU's: 4x GeForce RTX 2070
The full error stack:
Traceback (most recent call last):
File "demo.py", line 31, in <module>
peaks = hand_estimation(oriImg[y:y+w, x:x+w, :])
File "python/hand.py", line 46, in __call__
output = self.model(data).numpy()
TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
The text was updated successfully, but these errors were encountered:
First of all: thanks for your amazing work! I would like to use OpenPose, but can't run Caffe in my current setup/environment. This repo is a life-saver.
Now to the point: I got the following error when running the demo.py:
TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
I fixed this by changing the line in
python/hand.py
:output = self.model(data).numpy()
to:
output = self.model(data).cpu().numpy()
As numpy can't work on stuff that is still on the GPU.. I'm not sure if this needs to be changed in the repo and if this is the best solution for this error? Thanks.
My environment specs are the following:
OS: CentOS Linux release 7.5.1804
CUDA version: 8.0
cuDNN version: 7.0.5
Torch version: 0.4.1
Python version: Python 3.6.6
GPU's: 4x GeForce RTX 2070
The full error stack:
The text was updated successfully, but these errors were encountered: