question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run Visual Genome VGG16 model

See original GitHub issue

Whenever I try to run VGG16 trained on Visual Genome, I get errors of dimensions mismatches between the models.

I use this command to launch the test: python demo.py --net vgg16 --dataset vg --checksession 1 --checkepoch 19 --checkpoint 48611 --cuda --load_dir ./data/pretrained_model but I obtain the following error:

Traceback (most recent call last): File "demo.py", line 197, in <module> fasterRCNN.load_state_dict(checkpoint['model']) File "/root/faster-rcnn.pytorch/.venv/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 vgg16: 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 di mensions in the checkpoint are torch.Size([24, 512, 1, 1]). While copying the parameter named "RCNN_rpn.RPN_cls_score.bias", whose dimensions in the model are torch.Size([18]) and whose dimensions in t he checkpoint are torch.Size([24]). 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 di mensions in the checkpoint are torch.Size([48, 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 t he checkpoint are torch.Size([48]). While copying the parameter named "RCNN_cls_score.weight", whose dimensions in the model are torch.Size([21, 4096]) and whose dimensions in t he checkpoint are torch.Size([2501, 4096]). While copying the parameter named "RCNN_cls_score.bias", whose dimensions in the model are torch.Size([21]) and whose dimensions in the check point are torch.Size([2501]). While copying the parameter named "RCNN_bbox_pred.weight", whose dimensions in the model are torch.Size([84, 4096]) and whose dimensions in t he checkpoint are torch.Size([10004, 4096]). While copying the parameter named "RCNN_bbox_pred.bias", whose dimensions in the model are torch.Size([84]) and whose dimensions in the check point are torch.Size([10004]).

Am I missing something?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

7reactions
CyanideCentralcommented, Jul 1, 2018

It appears that two problems led to my error: The different dimensions of “RCNN_rpn.RPN_cls_score.bias” (18, 24) are caused by the default ANCHOR_SCALES parameter used in demo.py. Model trained on COCO dataset has anchor_scales [4,8,16,32], while demo uses the same [8,16,32] for all datasets as defined here. Thus, to run demo on model trained on COCO, change that line to [4,8,16,32]. The different dimensions of “RCNN_rpn.RPN_cls_score.bias” (21, 11) can be fixed by changing this line to the classes in your own dataset.

0reactions
alicedingyuemingcommented, Dec 17, 2018

may I ask you a question?How do you make vg dataset?I follow the process of bottom-up-attention, but can not get dataset as the project asked

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual_Genome.pdf - Visual Genome
In this paper, we present the Visual Genome dataset to enable the modeling of such relationships. We collect dense annotations of objects, attributes,...
Read more >
Visual Genome: Connecting Language and Vision Using ...
In this paper, we present the Visual Genome dataset to enable the modeling of such relationships. We collect dense annotations of objects, ...
Read more >
arXiv:1612.05386v1 [cs.CV] 16 Dec 2016
available datasets, Visual Genome and VQA, and show that ... additional image features extracted by VGG-16 models.
Read more >
Joint Modeling of Visual Objects and Relations for Scene ...
This work proposes a principled model to predict a whole scene graph by ... Authors have conducted extensive experiments on the Visual Genome...
Read more >
The Topology and Language of Relationships in the Visual ...
The Visual Genome Dataset therefore lends itself very well to the task of scene graph generation [3, 12, 13, 20], where given an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found