ruoqianguo / cascade-rcnn_Pytorch

An implementation of Cascade R-CNN: Delving into High Quality Object Detection.
MIT License
436 stars 107 forks source link

IndexError: Indexing a Tensor with a torch.cuda.LongTensor triggers index_select semantics, and thus we expect a vector, but the indexing Tensor passed has 0 dimensions #45

Open Lydaidai opened 5 years ago

Lydaidai commented 5 years ago

When training your own data set, the TRAIN.MAX_SIZE and TRAIN.SCALES parameters are modified, and random errors are reported during training. Traceback (most recent call last): File "trainval_net.py", line 359, in <module> roi_labels = FPN(im_data, im_info, gt_boxes, num_boxes) File "/home/zy/anaconda3/envs/pytorch03/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__ result = self.forward(*input, **kwargs) File "/home/zy/anaconda3/envs/pytorch03/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 73, in forward outputs = self.parallel_apply(replicas, inputs, kwargs) File "/home/zy/anaconda3/envs/pytorch03/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 83, in parallel_apply return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)]) File "/home/zy/anaconda3/envs/pytorch03/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 67, in parallel_apply raise output File "/home/zy/anaconda3/envs/pytorch03/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 42, in _worker output = module(*input, **kwargs) File "/home/zy/anaconda3/envs/pytorch03/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__ result = self.forward(*input, **kwargs) File "/home/zy/lvdailin/CascadeRCNN-master/lib/model/fpn/cascade/fpn.py", line 210, in forward gt_assign_pos = gt_assign[pos_id] IndexError: Indexing a Tensor with a torch.cuda.LongTensor triggers index_select semantics, and thus we expect a vector, but the indexing Tensor passed has 0 dimensions My environment: RTX 2080*8 python=3.6 pytorch=0.3.1 cuda=8.0 Maybe this is a version issue?