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 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
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)
The text was updated successfully, but these errors were encountered:
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)
The text was updated successfully, but these errors were encountered: