aster.pytorch
aster.pytorch copied to clipboard
about pretrain model
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
I cannot extract the pretrained model and the code shows the same error.
@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
@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()
.
I think you need to set global_args.with_lstm = True in model_builder.py to make it works.
I cannot extract the pretrained model and the code shows the same error.
You can directly load this pretrained model without extract it.