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

Pre-trained model load error #27

Open
TopGun666 opened this issue Oct 18, 2019 · 4 comments
Open

Pre-trained model load error #27

TopGun666 opened this issue Oct 18, 2019 · 4 comments

Comments

@TopGun666
Copy link

Hi @ChiWeiHsiao @alexart13 @daiyk

Thanks for your great work. I have a question about run test.py. When I load the trained model,it works well. But the when I change it to the optimizer, it broke down. It shows...

Traceback (most recent call last):
File "test.py", line 32, in
M_deepvo.load_state_dict(torch.load(load_optimizer_path))
File "/home/yanhzhan/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 777, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DeepVO:
Missing key(s) in state_dict: "conv1.0.weight", "conv1.1.weight", "conv1.1.bias", "conv1.1.running_mean", "conv1.1.running_var", "conv2.0.weight", "conv2.1.weight", "conv2.1.bias", "conv2.1.running_mean", "conv2.1.running_var", "conv3.0.weight", "conv3.1.weight", "conv3.1.bias", "conv3.1.running_mean", "conv3.1.running_var", "conv3_1.0.weight", "conv3_1.1.weight", "conv3_1.1.bias", "conv3_1.1.running_mean", "conv3_1.1.running_var", "conv4.0.weight", "conv4.1.weight", "conv4.1.bias", "conv4.1.running_mean", "conv4.1.running_var", "conv4_1.0.weight", "conv4_1.1.weight", "conv4_1.1.bias", "conv4_1.1.running_mean", "conv4_1.1.running_var", "conv5.0.weight", "conv5.1.weight", "conv5.1.bias", "conv5.1.running_mean", "conv5.1.running_var", "conv5_1.0.weight", "conv5_1.1.weight", "conv5_1.1.bias", "conv5_1.1.running_mean", "conv5_1.1.running_var", "conv6.0.weight", "conv6.1.weight", "conv6.1.bias", "conv6.1.running_mean", "conv6.1.running_var", "rnn.weight_ih_l0", "rnn.weight_hh_l0", "rnn.bias_ih_l0", "rnn.bias_hh_l0", "rnn.weight_ih_l1", "rnn.weight_hh_l1", "rnn.bias_ih_l1", "rnn.bias_hh_l1", "linear.weight", "linear.bias".
Unexpected key(s) in state_dict: "param_groups", "state".

I don't know how to fix it.

Best regards,
Yu

@grouptest123
Copy link

I have a question run main.py . It always alerts "Keyerror:'eps'"

@la735681253
Copy link

Hi @ChiWeiHsiao @alexart13 @daiyk

Thanks for your great work. I have a question about run test.py. When I load the trained model,it works well. But the when I change it to the optimizer, it broke down. It shows...

Traceback (most recent call last):
File "test.py", line 32, in
M_deepvo.load_state_dict(torch.load(load_optimizer_path))
File "/home/yanhzhan/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 777, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DeepVO:
Missing key(s) in state_dict: "conv1.0.weight", "conv1.1.weight", "conv1.1.bias", "conv1.1.running_mean", "conv1.1.running_var", "conv2.0.weight", "conv2.1.weight", "conv2.1.bias", "conv2.1.running_mean", "conv2.1.running_var", "conv3.0.weight", "conv3.1.weight", "conv3.1.bias", "conv3.1.running_mean", "conv3.1.running_var", "conv3_1.0.weight", "conv3_1.1.weight", "conv3_1.1.bias", "conv3_1.1.running_mean", "conv3_1.1.running_var", "conv4.0.weight", "conv4.1.weight", "conv4.1.bias", "conv4.1.running_mean", "conv4.1.running_var", "conv4_1.0.weight", "conv4_1.1.weight", "conv4_1.1.bias", "conv4_1.1.running_mean", "conv4_1.1.running_var", "conv5.0.weight", "conv5.1.weight", "conv5.1.bias", "conv5.1.running_mean", "conv5.1.running_var", "conv5_1.0.weight", "conv5_1.1.weight", "conv5_1.1.bias", "conv5_1.1.running_mean", "conv5_1.1.running_var", "conv6.0.weight", "conv6.1.weight", "conv6.1.bias", "conv6.1.running_mean", "conv6.1.running_var", "rnn.weight_ih_l0", "rnn.weight_hh_l0", "rnn.bias_ih_l0", "rnn.bias_hh_l0", "rnn.weight_ih_l1", "rnn.weight_hh_l1", "rnn.bias_ih_l1", "rnn.bias_hh_l1", "linear.weight", "linear.bias".
Unexpected key(s) in state_dict: "param_groups", "state".

I don't know how to fix it.

Best regards,
Yu

hi,i downloaded the trained model on “https://drive.google.com/file/d/1l0s3rYWgN8bL0Fyofee8IhN-0knxJF22/view”,but why it is broken?

@BrianWayland
Copy link

@grouptest123 Hi, I have the same problem with you. Have you solved it?

@KrMzyc
Copy link

KrMzyc commented Apr 16, 2024

It might be the issue of pytorch version。You can change the parameters self.resume to False to solve it

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

5 participants