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

The dict obtained from pretrained-model.pth had no the key "model_type" #26

Open
MichaelWU0726 opened this issue Aug 15, 2020 · 3 comments

Comments

@MichaelWU0726
Copy link

Hi, in inference_model.py", line 20, in init self.model = create_model(model_type=model_state['model_type'], drop_out=0) called by in cli.py line89 model = InferenceModel(path_to_model_state=path_to_model_state). I used pretrained-model.pth that you provided to validate it, and caused that KeyError: 'model_type'. I also printed the keys of dict obtained from loaded model you provided and it didn't have the key "model_type". Then, can you explain it for me? Thanks.

@Zijian007
Copy link

I met the same problem. Have you solved it?

@MichaelWU0726
Copy link
Author

I met the same problem. Have you solved it?

It had been too long and I forgot whether it was solved. For that, I guess it can be caused by the saved way of model file. There is a my article about it for referring No module named ‘models‘. If any question about this article, please ask me again.

@Cashel-000
Copy link

Thanks for your sharing! I met this problem too. May any solutions? Thank a lot!

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

3 participants