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
Adding Anchor scales #218
Comments
Solved. A change in the yml config file is required. using --cfgs and adding in the configuration variable with required list of anchor scales. |
This problem appears for model trained on COCO dataset. I fixed this by changing this line to [4,8,16,32]. |
@Worulz what should I add in res101.yml ? SCALES: [4,8,16,32] ? |
@kangkang59812 The important thing is that ( faster-rcnn.pytorch/trainval_net.py Line 166 in aec4244
In my case (at the PyTorch 1.0 branch), the demo runs flawlessly with the Pascal pretrained model, but I had this issue when trying it with COCO as @CyanideCentral reports. Apart from what I already mentioned, I also had a class mismatch using the demo (21 vs. 81). This is because the demo instantiates with the
Hope this helps! |
thanks a lot @andres-fr. But it still has the SIZE ERROR. I will spend some time to figure it out. Thanks again! |
@kangkang59812 those errors seem to be exactly the ones I fixed as I said. Did you try my approach? |
@andres-fr I have tried. But it results this error as before. |
@andres-fr
|
Hi,there. When running test_net.py with my own res101 pretrained model in PASCAL VOC dataset, I can not flawlessly perform and get the error below: |
@dreamedrainbow The official version of pytorch is easy to understand. |
thanks |
Hi I'm adding smaller anchor scales to detect smaller objects with also large objects.
I'm making changes to this line
args.set_cfgs = ['ANCHOR_SCALES', '[8, 16, 32]', 'ANCHOR_RATIOS', '[0.5,1,2]', 'MAX_NUM_GT_BOXES', '20']
to
args.set_cfgs = ['ANCHOR_SCALES', '[4, 8, 16, 32]', 'ANCHOR_RATIOS', '[0.5,1,2]', 'MAX_NUM_GT_BOXES', '20']
it works for the training script. but when I run it in demo.py it has issues:
error occurs here: link
fasterRCNN.load_state_dict(checkpoint['model'])
error message:
fasterRCNN.load_state_dict(checkpoint['model']) File "/home/ubuntu/py3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 721, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for resnet: While copying the parameter named "RCNN_rpn.RPN_cls_score.bias", whose dimensions in the model are torch.Size([18]) and whose dimensions in the checkpoint are torch.Size([24]). While copying the parameter named "RCNN_rpn.RPN_cls_score.weight", whose dimensions in the model are torch.Size([18, 512, 1, 1]) and whose dimensions in the checkpoint are torch.Size([24, 512, 1, 1]). While copying the parameter named "RCNN_rpn.RPN_bbox_pred.bias", whose dimensions in the model are torch.Size([36]) and whose dimensions in the checkpoint are torch.Size([48]). While copying the parameter named "RCNN_rpn.RPN_bbox_pred.weight", whose dimensions in the model are torch.Size([36, 512, 1, 1]) and whose dimensions in the checkpoint are torch.Size([48, 512, 1, 1]).
this is assuming the incorrect architecture is provided. I suspect there is something wrong with the configuration file fed in. but I'm not sure. Has anyone experienced this and has a solution?
thank you in advance!
The text was updated successfully, but these errors were encountered: