faster_rcnn_pytorch icon indicating copy to clipboard operation
faster_rcnn_pytorch copied to clipboard

RuntimeError in faster_rcnn.py

Open manyuyuya opened this issue 6 years ago • 3 comments

when I train on my own data,I meet an error when run the faster_rcnn.py,line 100,'rpn_loss_box = F.smooth_l1_loss(rpn_bbox_pred, rpn_bbox_targets, size_average=False) / (fg_cnt + 1e-4)'. It shows that "RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.cuda.LongTensor for argument #2 'other'“ And then, I try to train on VOC 2007,meeting the same error What's maybe the reason?

manyuyuya avatar May 14 '18 04:05 manyuyuya

I meet the same error two days ago , and I have not solve it . Have you solved the problem now ? I use python 2.7, pytorch 0.4.0

WilyZhao8 avatar Jun 15 '18 03:06 WilyZhao8

this system running torch 0.3.1

J911 avatar Mar 22 '19 05:03 J911

this is because the type of argument is wrong. you can change the type of argument by 'argument = argument.type(torch.FloatTensor)'

scscualex avatar Dec 18 '19 02:12 scscualex