-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi:
I was trying to fine tune the pretrained model on my data. however, when i was trying to run the finetune_mpp.py and loads the pretrained model from weights/pretrain/mpp, I couldn't load it since the Scage class, has no attribute model, while the original load functions is as follows:
model_path = os.path.join(self.config['pretrain_model_path'], model_name)
state_dict = torch.load(model_path, map_location='cuda')
model.model.load_model_state_dict(state_dict['model'])
Of course, I also tried model.load_state_dict directly, as everyone else would usually do for loading weights for pretrained data, but i got the following error:
RuntimeError: Error(s) in loading state_dict for Scage:
Missing key(s) in state_dict: "dist_bar", "head_Graph.linear_seq.0.weight", "head_Graph.linear_seq.0.bias", "head_Graph.linear_seq.3.weight", "head_Graph.linear_seq.3.bias", "head_finger_keeping_bond.linear_seq.0.weight", "head_finger_keeping_bond.linear_seq.0.bias", "head_finger_keeping_bond.linear_seq.3.weight", "head_finger_keeping_bond.linear_seq.3.bias".
Unexpected key(s) in state_dict: "bond_feature.embed_list.0.weight", "bond_feature.embed_list.1.weight", "bond_feature.embed_list.2.weight", "bond_feature.embed_list.3.weight", "bond_feature.embed_list.4.weight", "bond_feature.edge_type_embed.weight", "bond_feature.graph_embedding.weight", "bond_feature.distance_embedding.0.mean", "bond_feature.distance_embedding.0.std", "bond_feature.distance_embedding.0.mul.weight", "bond_feature.distance_embedding.0.bias.weight", "bond_feature.distance_embedding.1.weight", "bond_feature.distance_embedding.1.bias", "head_pair_distances.linear_in.0.weight", "head_pair_distances.linear_in.0.bias", "head_pair_distances.linear_in.2.weight", "head_pair_distances.linear_in.2.bias", "head_pair_distances.linear_out1.weight", "head_pair_distances.linear_out1.bias", "head_pair_distances.linear_out2.weight", "head_pair_distances.linear_out2.bias", "head_angle.linear_seq.0.weight", "head_angle.linear_seq.0.bias", "head_angle.linear_seq.1.weight", "head_angle.linear_seq.1.bias", "head_angle.linear_seq.1.running_mean", "head_angle.linear_seq.1.running_var", "head_angle.linear_seq.1.num_batches_tracked", "head_angle.linear_seq.4.weight", "head_angle.linear_seq.4.bias".
Looks like the design in pretrain.pth is not exactly the same as scage model itself? or there is some thing I did wrong?
Thanks for your time!
Sincerely,
Fanzhou