Missing key(s) in state_dict how do i fix this problem? #320
-
pysot/pysot-master$ bash demo.sh Does anyone have the same problem? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I encountered the same problem. PS: Don't forget to import the necessary modules (i.e. from pysot.utils.model_load import check_keys, remove_prefix) |
Beta Was this translation helpful? Give feedback.
-
@Grundwissen |
Beta Was this translation helpful? Give feedback.
-
Same problem, it also works for me, thank you so much @Grundwissen |
Beta Was this translation helpful? Give feedback.
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)