sj584 / EpiCluster

Apache License 2.0
3 stars 0 forks source link

Error in loading model #2

Closed tao840813 closed 10 months ago

tao840813 commented 10 months ago

Hello, I encountered this error when trying to read model parameters in evaluation.ipynb. May I inquire if there have been any changes to the model structure or other else afterward? ` ~\AppData\Local\Temp\ipykernel_23020\322533371.py in 15 dataset = example_pyg_list 16 ---> 17 true_label_list, pred_label_list = ensemble(direc, dataset, kfold, k=k+1, include_self=True, self_weight=self_w) 18 19

C:\EPICLUSTER\ensemble.py in ensemble(direc, data_pyg_list, kfold, k, include_self, self_weight) 26 for pt in pt_list: 27 print(f'{direc}/{pt}') ---> 28 model.load_state_dict(torch.load(f'{direc}/{pt}')) 29 model.eval() 30

c:\users\theodore\appdata\local\programs\python\python39\lib\site-packages\torch\nn\modules\module.py in load_state_dict(self, state_dict, strict, assign) 2150 2151 if len(error_msgs) > 0: -> 2152 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( 2153 self.class.name, "\n\t".join(error_msgs))) 2154 return _IncompatibleKeys(missing_keys, unexpected_keys)

RuntimeError: Error(s) in loading state_dict for JointModel: Unexpected key(s) in state_dict: "struct.graph_dec.0.weight", "struct.graph_dec.0.bias", "struct.graph_dec.2.weight", "struct.graph_dec.2.bias". `

sj584 commented 10 months ago

Thank you for showing interest at my work.

Unfortunately, while doing the revision, we found severe error which leads to the wrong conclusion. So I suggest not to use this model.

I apologize for posting any notice about the error. I will do the procedures needed.

tao840813 commented 10 months ago

Got it, thank you for your response!