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

Getting RuntimeError: Error(s) in loading state_dict for DataParallel: Missing key(s) in state_dict: #418

Open
alikhalil98771 opened this issue May 5, 2024 · 2 comments

Comments

@alikhalil98771
Copy link

I am using

python demo.py \
--Transformation TPS --FeatureExtraction ResNet --SequenceModeling BiLSTM --Prediction Attn \
--image_folder demo_image/ \
--saved_model arabic.pth

But I am getting always


    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DataParallel:
	Missing key(s) in state_dict: "module.Transformation.LocalizationNetwork.conv.0.weight", "module.Transformation.LocalizationNetwork.conv.1.weight", "module.Transformation.LocalizationNetwork.conv.1.bias", "module.Transformation.LocalizationNetwork.conv.1.running_mean", "module.Transformation.LocalizationNetwork.conv.1.running_var", "module.Transformation.LocalizationNetwork.conv.4.weight", "module.Transformation.LocalizationNetwork.conv.5.weight", "module.Transformation.LocalizationNetwork.conv.5.bias", "module.Transformation.LocalizationNetwork.conv.5.running_mean", "module.Transformation.LocalizationNetwork.conv.5.running_var", "module.Transformation.LocalizationNetwork.conv.8.weight", "module.Transformation.LocalizationNetwork.conv.9.weight", "module.Transformation.LocalizationNetwork.conv.9.bias", "module.Transformation.LocalizationNetwork.conv.9.running_mean", "module.Transformation.LocalizationNetwork.conv.9.running_var", "module.Transformation.LocalizationNetwork.conv.12.weight", "module.Transformation.LocalizationNetwork.conv.13.weight", "module.Transformation.LocalizationNetwork.conv.13.bias", "module.Transformation.LocalizationNetwork.conv.13.running_mean", "module.Transformation.LocalizationNetwork.conv.13.running_var", "module.Transformation.LocalizationNetwork.localization_fc1.0.weight", "module.Transformation.LocalizationNetwork.localization_fc1.0.bias", "module.Transformation.LocalizationNetwork.localization_fc2.weight", "module.Transformation.LocalizationNetwork.localization_fc2.bias", "module.Transformation.GridGenerator.inv_delta_C", "module.Transformation.GridGenerator.P_hat", "module.Prediction.attention_cell.i2h.weight", "module.Prediction.attention_cell.h2h.weight", "module.Prediction.attention_cell.h2h.bias", "module.Prediction.attention_cell.score.weight", "module.Prediction.attention_cell.rnn.weight_ih", "module.Prediction.attention_cell.rnn.weight_hh", "module.Prediction.attention_cell.rnn.bias_ih", "module.Prediction.attention_cell.rnn.bias_hh", "module.Prediction.generator.weight", "module.Prediction.generator.bias". 
	Unexpected key(s) in state_dict: "module.Prediction.weight", "module.Prediction.bias". 

Where I used the same version of torch which is 1.3.1

@Meriem-DAHMANI
Copy link

I am having the same error, please let me know if you solved it

@alikhalil98771
Copy link
Author

I was missing characters and I changed the FeatureExtraction

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

2 participants