Open xllau opened 6 years ago
I have the same problem
@xllau is in FPN paper.
@himpsky Hi, how to deal with Rois = []. When I try to train coco.py, an issue called "dimension out of range (expected to be in range of [-1, 0], but got 1)" account. Issue see as follows,
Traceback (most recent call last): File "/home/mh/workspace/pytorch-mask-rcnn-master/coco.py", line 500, in <module> layers='heads') File "/home/mh/workspace/pytorch-mask-rcnn-master/model.py", line 1809, in train_model loss, loss_rpn_class, loss_rpn_bbox, loss_mrcnn_class, loss_mrcnn_bbox, loss_mrcnn_mask = self.train_epoch(train_generator, optimizer, self.config.STEPS_PER_EPOCH) File "/home/mh/workspace/pytorch-mask-rcnn-master/model.py", line 1871, in train_epoch self.predict([images, image_metas, gt_class_ids, gt_boxes, gt_masks], mode='training') File "/home/mh/workspace/pytorch-mask-rcnn-master/model.py", line 1745, in predict mrcnn_class_logits, mrcnn_class, mrcnn_bbox = self.classifier(mrcnn_feature_maps, rois) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 491, in __call__ result = self.forward(*input, **kwargs) File "/home/mh/workspace/pytorch-mask-rcnn-master/model.py", line 943, in forward x = pyramid_roi_align([rois]+x, self.pool_size, self.image_shape) File "/home/mh/workspace/pytorch-mask-rcnn-master/model.py", line 436, in pyramid_roi_align y1, x1, y2, x2 = boxes.chunk(4, dim=1) RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)
And, we found it come into branch positive_count <=0 and negative_count <= 0, which resulted in 'rois = Variable(torch.FloatTensor(), requires_grad=False)'. How to deal with this situation?
I still cannot figure out this meaning. Can any one explain this for me? Much appreciation! roi_level = 4 + log2(torch.sqrt(h*w)/(224.0/torch.sqrt(image_area))) Equation 1 in the Feature Pyramid Networks paper. Account for the fact that our coordinates are normalized here. e.g. a 224x224 ROI (in pixels) maps to P4