ruoqianguo / DetNet_pytorch

An implementation of DetNet: A Backbone network for Object Detection.
MIT License
377 stars 117 forks source link

Input tensor must have same size as output tensor apart from the specified dimension at /pytorch/torch/lib/THC/generic/THCTensorScatterGather.cu:29 #2

Closed baolinhu closed 6 years ago

baolinhu commented 6 years ago

[session 1][epoch 1][iter 0/19370] loss: 2.0254, lr: 1.00e-03 fg/bg=(54/202), time cost: 2.824575 rpn_cls: 0.6977, rpn_box: 0.2524, rcnn_cls: 0.6933, rcnn_box 0.3820 Traceback (most recent call last): File "trainval_net.py", line 362, in <module> roi_labels = FPN(im_data, im_info, gt_boxes, num_boxes) File "/home/hubl/anaconda3/envs/gluon/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__ result = self.forward(*input, **kwargs) File "/home/hubl/code/DetNet_pytorch/lib/model/fpn/fpn.py", line 254, in forward bbox_pred_select = torch.gather(bbox_pred_view, 1, rois_label.long().view(rois_label.size(0), 1, 1).expand(rois_label.size(0), 1, 4)) RuntimeError: invalid argument 2: Input tensor must have same size as output tensor apart from the specified dimension at /pytorch/torch/lib/THC/generic/THCTensorScatterGather.cu:29 Exception ignored in: <bound method DataLoaderIter.__del__ of <torch.utils.data.dataloader.DataLoaderIter object at 0x7ff67f0827f0>> Traceback (most recent call last): File "/home/hubl/anaconda3/envs/gluon/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 333, in __del__ File "/home/hubl/anaconda3/envs/gluon/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 319, in _shutdown_workers File "/home/hubl/anaconda3/envs/gluon/lib/python3.6/multiprocessing/queues.py", line 337, in get ImportError: sys.meta_path is None, Python is likely shutting down Thanks for you code.Can you help me?

ruoqianguo commented 6 years ago

@baolinhu Sorry, i am not sure what's wrong with your code. Do you solve the problem? Are you using your own data set?

baolinhu commented 6 years ago

Thanks. I use my own data set.And I have solve the problem.Maybe is the data set problem.

KevinQian97 commented 6 years ago

@baolinhu Hi I am encountered with the same problem using my personal data, would you mind telling me why this happened? Because my dataset works good on faster-rcnn, but it failed if I add fpn code.

foralliance commented 5 years ago

@baolinhu @KevinQian97

same problem with u. can u solve the problem??many many thanks!!!

baolinhu commented 5 years ago

@foralliance Maybe you need delete the dataset cache.

guo234567 commented 4 years ago

same problem with u. can u solve the problem??many many thanks!!!

guo234567 commented 4 years ago

谢谢。我使用自己的数据集并且已经解决了问题,也许是数据集问题。

same problem with u. can u solve the problem??many many thanks!!!

zhimawa commented 4 years ago

Hello,I also met this same problem using my personal data and didn't solve it already. I tried to delete the dataset cache but it didn't work, would you mind telling me how to solve it? Thanks a lot!@baolinhu @KevinQian97 @guo234567

Amirjomaa commented 2 years ago

resize the images