multimodallearning / pytorch-mask-rcnn

Other
2.01k stars 557 forks source link

Pytorch 0.4 #24

Open wwoody827 opened 6 years ago

wwoody827 commented 6 years ago

Training is not working in pytorch 0.4. Mainly due to some conditions in if require zero size tensor to be None type while pytorch 0.4 now support zero size tensor.... But after correct these if statement, now I sometime got boxes in pyramid_roi_align() to be size zero. Anyone else trying to make it running with pytorch 0.4? Any ideas?

thomaschristinck commented 6 years ago

was working on this but gave up. Let me know if you get it working in 0.4

finlay-liu commented 6 years ago

sad, need help.

jwjohnson314 commented 6 years ago

I started looking at this recently. Will update if I get it working.

hnshahao commented 6 years ago

Hi,guys, in Pytorch 0.4, if the tensor has no element, size() will return [0], so in this code, we need to change the if judgement part from size() to size()[0]

for example: if not rois.size(): - > if not rois.size()[0]: if not target_class_ids.size(): -> if not target_class_ids.size()[0]:

You can search and substitute.

CasonTsai commented 5 years ago

the .size() function in Pytorch 0.4 is different from Pytorch 0.3, you can modify the model.py ,change .size() into .size()[0] There are several changes that need to be made 568: if torch.nonzero(gt_class_ids < 0).size(): 597: if torch.nonzero(positive_roi_bool).size(): 656: if torch.nonzero(negative_roi_bool).size() and positive_count>0: 1056: if target_class_ids.size(): 1074: if target_class_ids.size(): 1104: if target_class_ids.size(): 1716: if not rois.size(): 1934: if not target_class_ids.size():