ruoqianguo / FPN_Pytorch

Base jwyang/fpn.pytorch, train FPN on Pascal VOC get 80.5 mAP
MIT License
103 stars 19 forks source link

index(): argument 'indices' (position 1) must be tuple of Tensors, not Tensor #12

Open zhiwenhou1227 opened 4 years ago

zhiwenhou1227 commented 4 years ago

when i run trainval_net.py in python 3.6, pytorch 0.4.0,i meet this error ,how can i solve it,than you! Traceback (most recent call last): File "/FPN_Pytorch-master/trainval_net.py", line 366, in roi_labels = FPN(im_data, im_info, gt_boxes, num_boxes) File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, *kwargs) File "/FPN_Pytorch-master/lib/model/fpn/fpn.py", line 195, in forward roi_data = self.RCNN_proposal_target(rois, gt_boxes, num_boxes) File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(input, **kwargs) File "/FPN_Pytorch-master/lib/model/rpn/proposal_target_layer.py", line 52, in forward rois_per_image, self._num_classes) File "/FPN_Pytorch-master/lib/model/rpn/proposal_target_layer.py", line 133, in _sample_rois_pytorch labels = gt_boxes[:,:,4].contiguous().view(-1).index(offset.view(-1))\ TypeError: index(): argument 'indices' (position 1) must be tuple of Tensors, not Tensor