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

How to use the cnn_df.pt #2

Open
MaSinless opened this issue Jun 7, 2023 · 3 comments
Open

How to use the cnn_df.pt #2

MaSinless opened this issue Jun 7, 2023 · 3 comments

Comments

@MaSinless
Copy link

Thanks so much for the paper and repo.
I encountered some errors when using cnn_df.pt model, could you please tell me how to load this file?
image
image

@georgeretsi
Copy link
Owner

Greetings! Can you please provide the whole error description. Probably is a size missmatch of tensors.

@MaSinless
Copy link
Author

Thanks for your reply, the following is the whole error description.
net.load_state_dict(torch.load('cnn_df.pt')) File "D:\Program Files\anaconda3\envs\pytorch-gpu-1.11\lib\site-packages\torch\nn\modules\module.py", line 1497, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for HTRNetC: Unexpected key(s) in state_dict: "features.features.cnv1.stn.cnn.0.weight", "features.features.cnv1.stn.cnn.0.bias", "features.features.cnv1.stn.last.weight", "features.features.cnv1.stn.last.bias", "features.features.cnv2.stn.cnn.0.weight", "features.features.cnv2.stn.cnn.0.bias", "features.features.cnv2.stn.last.weight", "features.features.cnv2.stn.last.bias", "features.features.cnv3.stn.cnn.0.weight", "features.features.cnv3.stn.cnn.0.bias", "features.features.cnv3.stn.last.weight", "features.features.cnv3.stn.last.bias", "features.features.cnv4.stn.cnn.0.weight", "features.features.cnv4.stn.cnn.0.bias", "features.features.cnv4.stn.last.weight", "features.features.cnv4.stn.last.bias", "features.features.cnv5.stn.cnn.0.weight", "features.features.cnv5.stn.cnn.0.bias", "features.features.cnv5.stn.last.weight", "features.features.cnv5.stn.last.bias", "features.features.cnv6.stn.cnn.0.weight", "features.features.cnv6.stn.cnn.0.bias", "features.features.cnv6.stn.last.weight", "features.features.cnv6.stn.last.bias", "features.features.cnv7.stn.cnn.0.weight", "features.features.cnv7.stn.cnn.0.bias", "features.features.cnv7.stn.last.weight", "features.features.cnv7.stn.last.bias", "features.features.cnv8.stn.cnn.0.weight", "features.features.cnv8.stn.cnn.0.bias", "features.features.cnv8.stn.last.weight", "features.features.cnv8.stn.last.bias", "features.features.cnv9.stn.cnn.0.weight", "features.features.cnv9.stn.cnn.0.bias", "features.features.cnv9.stn.last.weight", "features.features.cnv9.stn.last.bias", "features.features.cnv10.stn.cnn.0.weight", "features.features.cnv10.stn.cnn.0.bias", "features.features.cnv10.stn.last.weight", "features.features.cnv10.stn.last.bias".
And I did not reproduce the accuracy published in the paper, could you please share the hyperparameters setting in the experiment?

@georgeretsi
Copy link
Owner

The error indicates that the saved model has enabled the STN submodule. You can try the definition of the model with stn=True and check if this works alright.

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