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

RuntimeError: Error(s) in loading state_dict for GnnNets: Missing key(s) in state_dict: "model.gnn_layers.0.lin.weight", "model.gnn_layers.1.lin.weight", "model.gnn_layers.2.lin.weight". #217

Open
maxheming opened this issue Jul 7, 2023 · 0 comments

Comments

@maxheming
Copy link

I have this problem,
RuntimeError: Error(s) in loading state_dict for GnnNets:
Missing key(s) in state_dict: "model.gnn_layers.0.lin.weight", "model.gnn_layers.1.lin.weight", "model.gnn_layers.2.lin.weight".

in this code
def update_state_dict(self, state_dict):
original_state_dict = self.state_dict()
print('dict',state_dict.items())
loaded_state_dict = dict()
for k, v in state_dict.items():
if k in original_state_dict.keys():
loaded_state_dict[k] = v
self.load_state_dict(loaded_state_dict)

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

1 participant