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

how to run batch_demo.py? #20

Open
twinkleShen opened this issue Aug 14, 2019 · 2 comments
Open

how to run batch_demo.py? #20

twinkleShen opened this issue Aug 14, 2019 · 2 comments

Comments

@twinkleShen
Copy link

I have successfully run the python file test.py and da_trainval_net.py,but failed to run batch_demo.py,I dont known the reason.
I met with such question:

RuntimeError: Error(s) in loading state_dict for vgg16: Unexpected key(s) in state_dict: "RCNN_imageDA.Conv1.weight", "RCNN_imageDA.Conv2.weight", "RCNN_instanceDA.dc_ip1.weight", "RCNN_instanceDA.dc_ip1.bias", "RCNN_instanceDA.dc_ip2.weight", "RCNN_instanceDA.dc_ip2.bias", "RCNN_instanceDA.clssifer.weight", "RCNN_instanceDA.clssifer.bias". While copying the parameter named "RCNN_cls_score.weight", whose dimensions in the model are torch.Size([21, 4096]) and whose dimensions in the checkpoint are torch.Size([9, 4096]). While copying the parameter named "RCNN_cls_score.bias", whose dimensions in the model are torch.Size([21]) and whose dimensions in the checkpoint are torch.Size([9]). While copying the parameter named "RCNN_bbox_pred.weight", whose dimensions in the model are torch.Size([84, 4096]) and whose dimensions in the checkpoint are torch.Size([36, 4096]). While copying the parameter named "RCNN_bbox_pred.bias", whose dimensions in the model are torch.Size([84]) and whose dimensions in the checkpoint are torch.Size([36]).

how can I observe the transform phenomenon?can someone tell me?

@tiancity-NJU
Copy link
Owner

tiancity-NJU commented Sep 26, 2019

This problem may because the class number is different between the checkpoint and your test dataset, so you just need to change the class number, it will be work

@lifuyu
Copy link

lifuyu commented Dec 9, 2019

modify line197 fasterRCNN.load_state_dict(checkpoint['model'],strict=False)could solve this problem

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

3 participants