Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roi_level = 4 + log2(torch.sqrt(h*w)/(224.0/torch.sqrt(image_area))) #27

Open
xllau opened this issue Jun 22, 2018 · 3 comments
Open

roi_level = 4 + log2(torch.sqrt(h*w)/(224.0/torch.sqrt(image_area))) #27

xllau opened this issue Jun 22, 2018 · 3 comments

Comments

@xllau
Copy link

xllau commented Jun 22, 2018

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

@gjd2017
Copy link

gjd2017 commented Aug 16, 2018

I have the same problem

@himpsky
Copy link

himpsky commented Sep 30, 2018

@xllau
image
is in FPN paper.

@LaiPiXiong
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants