aster.pytorch icon indicating copy to clipboard operation
aster.pytorch copied to clipboard

about pretrain model

Open xuefanfu opened this issue 4 years ago • 5 comments

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

xuefanfu avatar Nov 30 '20 03:11 xuefanfu

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

psuu0001 avatar Feb 18 '21 12:02 psuu0001

@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

Charlyo avatar Mar 08 '21 15:03 Charlyo

@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().

dsandii avatar Mar 11 '21 20:03 dsandii

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

quocanh010 avatar Apr 19 '21 18:04 quocanh010

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

You can directly load this pretrained model without extract it.

ayumiymk avatar Jun 03 '21 22:06 ayumiymk