Skip to content

TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. #47

@fglks

Description

@fglks

python scripts/train_rpn_3d.py --config=kitti_3d_multi_warmup:

Traceback (most recent call last):
File "scripts/train_rpn_3d.py", line 196, in
main(sys.argv[1:])
File "scripts/train_rpn_3d.py", line 125, in main
det_loss, det_stats = criterion_det(cls, prob, bbox_2d, bbox_3d, imobjs, feat_size)
File "/home/user/anaconda3/envs/M3DRPN/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/user/yty/M3D-RPN-master/lib/loss/rpn_3d.py", line 126, in forward
src_anchors = self.anchors[rois[:, 4].type(torch.cuda.LongTensor), :]
File "/home/user/anaconda3/envs/M3DRPN/lib/python3.6/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions