You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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".
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: