Skip to content

Missing key(s) in state_dict how do i fix this problem? #320

Answered by Grundwissen
way790110 asked this question in General
Discussion options

You must be logged in to vote

I encountered the same problem.
The pysot framework is saving your weights with DataParallel. By lodading your model in demo.py you have to exclude the keys in state_dict (i.e. in your case "epoch", "state_dict", "optimizer").
I solved this problem by inserting the "load model" code from the test.py to demo.py:
This is a Screenshot from my demo.py file

PS: Don't forget to import the necessary modules (i.e. from pysot.utils.model_load import check_keys, remove_prefix)

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@vic01512
Comment options

Answer selected by ZhiyuanChen
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #320 on September 10, 2020 09:52.