Tencent / FaceDetection-DSFD

腾讯优图高精度双分支人脸检测器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't convert CUDA tensor to numpy

elkizana opened this issue · comments

Hello I have this issue :

File "demo.py", line 249, in <module> test_oneimage() File "demo.py", line 244, in test_oneimage det = bbox_vote(det) File "demo.py", line 69, in bbox_vote det_accu_sum[:, 0:4] = np.sum(det_accu[:, 0:4], axis=0) / np.sum(det_accu[:, -1:]) File "/usr/local/lib/python3.7/site-packages/torch/tensor.py", line 398, in __rdiv__ return self.reciprocal() * other File "/usr/local/lib/python3.7/site-packages/torch/tensor.py", line 486, in __array__ return self.numpy() TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

@Barbarosse I had this same error, but it turned out to be caused by something else.

I don't remember exactly, but this article covers how to implement the demo file.

@Barbarosse I had this same error, but it turned out to be caused be something else.

I don't remember exactly, but this article covers how to implement the demo file.

Thanks

@Barbarosse Hi there, could you tell me how did you resolve this error? I just got the same error. Thanks.