yikang-li / MSDN

This is our PyTorch implementation of Multi-level Scene Description Network (MSDN) proposed in our ICCV 2017 paper.
http://cvboy.com/publication/iccv2017_msdn/
227 stars 51 forks source link

'Tensor' object has no attribute 'astype' #22

Open adidasnike90 opened 4 years ago

adidasnike90 commented 4 years ago

File "/home/frank/MSDN/faster_rcnn/fast_rcnn/bbox_transform.py", line 78, in bbox_transform_inv_hdn boxes = boxes.astype(deltas.dtype, copy=False) AttributeError: 'Tensor' object has no attribute 'astype'

adidasnike90 commented 4 years ago

I fixed this problem: in faster_rcnn/MSDN.py line 420: boxes = rois.data.cpu().numpy()[keep, 1:5] / im_info[0][2], change to boxes = rois.data.cpu().numpy()[keep, 1:5] / im_info[0][2].numpy(), because im_info[0][2]is a torch.Tensor type, but we need a ndarray type here.