-
Notifications
You must be signed in to change notification settings - Fork 28
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
Questions about model validation #19
Comments
Hello,I have the same problem too.Have you solve it? |
|
I have already solved this problem.In the original code the valideate.py needs the pth which only contains two keys:"weight" and "bias",which are the parameters of the final linear layer of the model.However ,after our own training, the pth we saved has three keys:"model", "optimizer", "total_steps",and the "model" contains the paramerters of all the layers in the model.Therfore,you can delete all the other things except the last two parameters of "model" in your pth,which are the needed "weight" and "bias". |
in validate.py
|
RuntimeError: Error(s) in loading state_dict for Linear:
Missing key(s) in state_dict: "weight", "bias".
Unexpected key(s) in state_dict: "model", "optimizer", "total_steps".
When I use my trained epoch.pth for validate.py, it throws an error. How can I resolve this?
The text was updated successfully, but these errors were encountered: