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

about pretrain model #61

Open
xuefanfu opened this issue Nov 30, 2020 · 5 comments
Open

about pretrain model #61

xuefanfu opened this issue Nov 30, 2020 · 5 comments

Comments

@xuefanfu
Copy link

load pretrain model falling,some error information are demonstrated follow。
raise ValueError("=> No checkpoint found at '{}'".format(load_path))
I want to consult whether the model is distoryed

@psuu0001
Copy link

I cannot extract the pretrained model and the code shows the same error.

@Charlyo
Copy link

Charlyo commented Mar 8, 2021

@ayumiymk Getting Unexpected key(s) in state_dict: "tps.inverse_kernel", "tps.padding_matrix", "tps.target_coordinate_repr", "tps.target_control_points", "stn_head.stn_convnet.0.0.weight", "stn_head.stn_convnet.0.0.bias", "stn_head.stn_convnet.0.1.weight", "stn_head.stn_convnet.0.1.bias", "stn_head.stn_convnet.0.1.running_mean", "stn_head.stn_convnet.0.1.running_var", "stn_head.stn_convnet.0.1.num_batches_tracked", "stn_head.stn_convnet.2.0.weight", "stn_head.stn_convnet.2.0.bias", "stn_head.stn_convnet.2.1.weight", "stn_head.stn_convnet.2.1.bias", "stn_head.stn_convnet.2.1.running_mean", "stn_head.stn_convnet.2.1.running_var", "stn_head.stn_convnet.2.1.num_batches_tracked", "stn_head.stn_convnet.4.0.weight", "stn_head.stn_convnet.4.0.bias", "stn_head.stn_convnet.4.1.weight", "stn_head.stn_convnet.4.1.bias", "stn_head.stn_convnet.4.1.running_mean", "stn_head.stn_convnet.4.1.running_var", "stn_head.stn_convnet.4.1.num_batches_tracked", "stn_head.stn_convnet.6.0.weight", "stn_head.stn_convnet.6.0.bias", "stn_head.stn_convnet.6.1.weight", "stn_head.stn_convnet.6.1.bias", "stn_head.stn_convnet.6.1.running_mean", "stn_head.stn_convnet.6.1.running_var", "stn_head.stn_convnet.6.1.num_batches_tracked", "stn_head.stn_convnet.8.0.weight", "stn_head.stn_convnet.8.0.bias", "stn_head.stn_convnet.8.1.weight", "stn_head.stn_convnet.8.1.bias", "stn_head.stn_convnet.8.1.running_mean", "stn_head.stn_convnet.8.1.running_var", "stn_head.stn_convnet.8.1.num_batches_tracked", "stn_head.stn_convnet.10.0.weight", "stn_head.stn_convnet.10.0.bias", "stn_head.stn_convnet.10.1.weight", "stn_head.stn_convnet.10.1.bias", "stn_head.stn_convnet.10.1.running_mean", "stn_head.stn_convnet.10.1.running_var", "stn_head.stn_convnet.10.1.num_batches_tracked", "stn_head.stn_fc1.0.weight", "stn_head.stn_fc1.0.bias", "stn_head.stn_fc1.1.weight", "stn_head.stn_fc1.1.bias", "stn_head.stn_fc1.1.running_mean", "stn_head.stn_fc1.1.running_var", "stn_head.stn_fc1.1.num_batches_tracked", "stn_head.stn_fc2.weight", "stn_head.stn_fc2.bias", "encoder.rnn.weight_ih_l0", "encoder.rnn.weight_hh_l0", "encoder.rnn.bias_ih_l0", "encoder.rnn.bias_hh_l0", "encoder.rnn.weight_ih_l0_reverse", "encoder.rnn.weight_hh_l0_reverse", "encoder.rnn.bias_ih_l0_reverse", "encoder.rnn.bias_hh_l0_reverse", "encoder.rnn.weight_ih_l1", "encoder.rnn.weight_hh_l1", "encoder.rnn.bias_ih_l1", "encoder.rnn.bias_hh_l1", "encoder.rnn.weight_ih_l1_reverse", "encoder.rnn.weight_hh_l1_reverse", "encoder.rnn.bias_ih_l1_reverse", "encoder.rnn.bias_hh_l1_reverse".

With pytorch 1.1.0 / vision 0.3.0

@dsandii
Copy link

dsandii commented Mar 11, 2021

@ayumiymk Getting Unexpected key(s) in state_dict: "tps.inverse_kernel", "tps.padding_matrix", "tps.target_coordinate_repr", "tps.target_control_points", "stn_head.stn_convnet.0.0.weight", "stn_head.stn_convnet.0.0.bias", "stn_head.stn_convnet.0.1.weight", "stn_head.stn_convnet.0.1.bias", "stn_head.stn_convnet.0.1.running_mean", "stn_head.stn_convnet.0.1.running_var", "stn_head.stn_convnet.0.1.num_batches_tracked", "stn_head.stn_convnet.2.0.weight", "stn_head.stn_convnet.2.0.bias", "stn_head.stn_convnet.2.1.weight", "stn_head.stn_convnet.2.1.bias", "stn_head.stn_convnet.2.1.running_mean", "stn_head.stn_convnet.2.1.running_var", "stn_head.stn_convnet.2.1.num_batches_tracked", "stn_head.stn_convnet.4.0.weight", "stn_head.stn_convnet.4.0.bias", "stn_head.stn_convnet.4.1.weight", "stn_head.stn_convnet.4.1.bias", "stn_head.stn_convnet.4.1.running_mean", "stn_head.stn_convnet.4.1.running_var", "stn_head.stn_convnet.4.1.num_batches_tracked", "stn_head.stn_convnet.6.0.weight", "stn_head.stn_convnet.6.0.bias", "stn_head.stn_convnet.6.1.weight", "stn_head.stn_convnet.6.1.bias", "stn_head.stn_convnet.6.1.running_mean", "stn_head.stn_convnet.6.1.running_var", "stn_head.stn_convnet.6.1.num_batches_tracked", "stn_head.stn_convnet.8.0.weight", "stn_head.stn_convnet.8.0.bias", "stn_head.stn_convnet.8.1.weight", "stn_head.stn_convnet.8.1.bias", "stn_head.stn_convnet.8.1.running_mean", "stn_head.stn_convnet.8.1.running_var", "stn_head.stn_convnet.8.1.num_batches_tracked", "stn_head.stn_convnet.10.0.weight", "stn_head.stn_convnet.10.0.bias", "stn_head.stn_convnet.10.1.weight", "stn_head.stn_convnet.10.1.bias", "stn_head.stn_convnet.10.1.running_mean", "stn_head.stn_convnet.10.1.running_var", "stn_head.stn_convnet.10.1.num_batches_tracked", "stn_head.stn_fc1.0.weight", "stn_head.stn_fc1.0.bias", "stn_head.stn_fc1.1.weight", "stn_head.stn_fc1.1.bias", "stn_head.stn_fc1.1.running_mean", "stn_head.stn_fc1.1.running_var", "stn_head.stn_fc1.1.num_batches_tracked", "stn_head.stn_fc2.weight", "stn_head.stn_fc2.bias", "encoder.rnn.weight_ih_l0", "encoder.rnn.weight_hh_l0", "encoder.rnn.bias_ih_l0", "encoder.rnn.bias_hh_l0", "encoder.rnn.weight_ih_l0_reverse", "encoder.rnn.weight_hh_l0_reverse", "encoder.rnn.bias_ih_l0_reverse", "encoder.rnn.bias_hh_l0_reverse", "encoder.rnn.weight_ih_l1", "encoder.rnn.weight_hh_l1", "encoder.rnn.bias_ih_l1", "encoder.rnn.bias_hh_l1", "encoder.rnn.weight_ih_l1_reverse", "encoder.rnn.weight_hh_l1_reverse", "encoder.rnn.bias_ih_l1_reverse", "encoder.rnn.bias_hh_l1_reverse".

With pytorch 1.1.0 / vision 0.3.0

Did you make any progress with this?
I'm getting a very similar error:

RuntimeError: Error(s) in loading state_dict for ModelBuilder:
	Unexpected key(s) in state_dict: "encoder.rnn.weight_ih_l0", "encoder.rnn.weight_hh_l0", "encoder.rnn.bias_ih_l0", "encoder.rnn.bias_hh_l0", "encoder.rnn.weight_ih_l0_reverse", "encoder.rnn.weight_hh_l0_reverse", "encoder.rnn.bias_ih_l0_reverse", "encoder.rnn.bias_hh_l0_reverse", "encoder.rnn.weight_ih_l1", "encoder.rnn.weight_hh_l1", "encoder.rnn.bias_ih_l1", "encoder.rnn.bias_hh_l1", "encoder.rnn.weight_ih_l1_reverse", "encoder.rnn.weight_hh_l1_reverse", "encoder.rnn.bias_ih_l1_reverse", "encoder.rnn.bias_hh_l1_reverse". 

When I print the model before trying to restore the weights, there definitely isn't an RNN module in the encoder. I'm confused as to why it exists in the checkpoint's state_dict but not on the model produced by ModelBuilder().

@quocanh010
Copy link

I think you need to set global_args.with_lstm = True in model_builder.py to make it works.

@ayumiymk
Copy link
Owner

ayumiymk commented Jun 3, 2021

I cannot extract the pretrained model and the code shows the same error.

You can directly load this pretrained model without extract 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

6 participants