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.

Key mismatch while loading the model?

See original GitHub issue

I am having issue loading the trained checkpoint to FPNSSD512 model. How can I fix that?

RuntimeError: Error(s) in loading state_dict for FPNSSD512:
	Missing key(s) in state_dict: "fpn.conv1.weight", "fpn.bn1.running_var", "fpn.bn1.bias", "fpn.bn1.running_mean", "fpn.bn1.weight", "fpn.layer1.0.conv1.weight", "fpn.layer1.0.bn1.running_var", "fpn.layer1.0.bn1.bias", "fpn.layer1.0.bn1.running_mean", "fpn.layer1.0.bn1.weight", "fpn.layer1.0.conv2.weight", "fpn.layer1.0.bn2.running_var", "fpn.layer1.0.bn2.bias", 

        Unexpected key(s) in state_dict: "module.fpn.conv1.weight", "module.fpn.bn1.weight", "module.fpn.bn1.bias", "module.fpn.bn1.running_mean", "module.fpn.bn1.running_var", "module.fpn.layer1.0.conv1.weight"

Issue Analytics

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

github_iconTop GitHub Comments

12reactions
root-mastercommented, Oct 10, 2018

If you want to load the weights after DataParallel use: net.module.load_state_dict(pertained_weights) If you want to load the weights before DataParallel use: net.load_state_dict(pertained_weights)

3reactions
silkylovecommented, Oct 21, 2018

@ahkarami I uploaded the sgd training and eval log. And with sgd, I can only got aound 76% mAP now. The pretrained model was in here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can i solve Foreign key mismatch error in django?
Find the migration file that has Field model, delete it, then run makemigrations again. The migrations file is in the migrations folder (the ......
Read more >
RuntimeError: Error(s) in loading state_dict for DynamicUnet
Here, I aim to load the model and weights to run inference with new ... key(s) in state_dict: "layers.0.4.0.conv3.weight" | size mismatch ......
Read more >
I get a message about data type mismatch - Microsoft Support
This error indicates that Access cannot match an input value to the data type it expects for the value. For example, if you...
Read more >
Datasets not behaving as expected after random data ...
ValueError : Keys mismatch: between {'indices': Value(dtype='uint64', ... Before I train my model on several augmented datasets, I check and each dataset is ......
Read more >
Keras load pre-trained weights. Shape mismatch
Apparently, there is a mismatch in architecture between model and the original model which was used to generate my_weights.h5 . Compare summary ...
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