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

Parameter size mismatch when loading pretrained models #7

Open
qid12 opened this issue Mar 4, 2022 · 0 comments
Open

Parameter size mismatch when loading pretrained models #7

qid12 opened this issue Mar 4, 2022 · 0 comments

Comments

@qid12
Copy link

qid12 commented Mar 4, 2022

Hi, I run into errors when trying to load pretrained models.
I downloaded and processed the DB5.5 dataset, and by running get_dataloader, I could see that the 'input_edge_feats_dim' is 27 for this dataset. But then as I run:

model = create_model(args, log)
model.load_state_dict(checkpoint['state_dict'])

I got the error of 'size mismatch' for many parameters:
image

Here's the args I was using:
{'debug': False, 'log_every': 100000, 'random_seed': 8, 'data': 'db5', 'data_fraction': 1.0, 'split': 0, 'worker': 0, 'n_jobs': 1, 'lr': 0.0003, 'w_decay': 0.0001, 'scheduler': 'warmup', 'warmup': 1.0, 'patience': 50, 'num_epochs': 10000, 'clip': 100.0, 'bs': 10, 'graph_nodes': 'residues', 'graph_cutoff': 30.0, 'graph_max_neighbor': 10, 'graph_residue_loc_is_alphaC': False, 'pocket_cutoff': 8.0, 'translation_interval': 5.0, 'rot_model': 'kb_att', 'num_att_heads': 50, 'pocket_ot_loss_weight': 1.0, 'intersection_loss_weight': 10.0, 'intersection_sigma': 25.0, 'intersection_surface_ct': 10.0, 'dropout': 0.0, 'layer_norm': 'LN', 'layer_norm_coors': '0', 'final_h_layer_norm': '0', 'nonlin': 'lkyrelu', 'iegmn_lay_hid_dim': 64, 'iegmn_n_lays': 5, 'residue_emb_dim': 64, 'shared_layers': False, 'cross_msgs': False, 'divide_coors_dist': False, 'use_dist_in_layers': False, 'use_edge_features_in_gmn': False, 'noise_decay_rate': 0.0, 'noise_initial': 0.0, 'use_mean_node_features': False, 'skip_weight_h': 0.5, 'leakyrelu_neg_slope': 0.01, 'x_connection_init': 0.0, 'hyper_search': False, 'fine_tune': False, 'toy': False, 'continue_train_model': '', 'device': device(type='cuda', index=1), 'cache_path': './cache/db5_residues_maxneighbor_10_cutoff_30.0_pocketCut_8.0/', 'checkpoint_dir': './checkpts/EQUIDOCK__drp_0.0#Wdec_0.0001#ITS_lw_10.0#Hdim_64#Nlay_5#shrdLay_F#SURFfs_F#ln_LN#lnX_0#Hnrm_0#NattH_50#skH_0.5#xConnI_0.0#LkySl_0.01#pokOTw_1.0#divXdist_F#', 'tb_log_dir': './tb_logs/EQUIDOCK__drp_0.0#Wdec_0.0001#ITS_lw_10.0#Hdim_64#Nlay_5#shrdLay_F#SURFfs_F#ln_LN#lnX_0#Hnrm_0#NattH_50#skH_0.5#xConnI_0.0#LkySl_0.01#pokOTw_1.0#divXdist_F#', 'input_edge_feats_dim': 27, 'iegnm_lay_hid_dim': 69}

Could you please help me with this error? I wonder maybe some of the model parameters was different in the pretrained model. Please let me know what I could change to set the param size right, thank you very much!

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