ChiWeiHsiao / DeepVO-pytorch

PyTorch Implementation of DeepVO
346 stars 105 forks source link

Pre-trained model load error #27

Open TopGun666 opened 4 years ago

TopGun666 commented 4 years ago

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 commented 4 years ago

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

la735681253 commented 4 years ago

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 commented 3 years ago

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

KrMzyc commented 5 months ago

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