openfold icon indicating copy to clipboard operation
openfold copied to clipboard

Unexpected key(s) in state_dict: "aux_heads.tm.linear.weight", "aux_heads.tm.linear.bias"

Open srayan00 opened this issue 1 year ago • 4 comments

I am trying to run inference using OpenFold and I found that finetining_ptm_2.pt was missing in openfold/resources/openfold_params. I found a similar file on hugging faces and used their file. But I am getting the following error :

Traceback (most recent call last): File "/opt/openfold/run_pretrained_openfold.py", line 391, in <module> main(args) File "/opt/openfold/run_pretrained_openfold.py", line 203, in main for model, output_directory in model_generator: File "/opt/openfold/openfold/utils/script_utils.py", line 101, in load_models_from_command_line model.load_state_dict(d) File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1605, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for AlphaFold: Unexpected key(s) in state_dict: "aux_heads.tm.linear.weight", "aux_heads.tm.linear.bias".

The huggingfaces file is from 11 months ago. So, is there a more recent file that I can use or should I remove those keys altogether?

srayan00 avatar May 18 '23 14:05 srayan00

you may need to add the config_preset command. In the README this is used in the non-docker example, but not the docker example and resolved this issue in my use. --config_preset "model_1_ptm" \

roivant-matts avatar May 25 '23 15:05 roivant-matts

I don't use docker to run the code, but get the same issue, and try the config_preset config, it doesn't work. Have somebody solved this problem? please give me a hand.

lijxgit avatar Sep 07 '23 06:09 lijxgit

I found that using the "finetuning_ptm_1.pt" to replace "finetining_ptm_2.pt" can work well.

lijxgit avatar Sep 07 '23 06:09 lijxgit

Hello!

I' ve got such error RuntimeError: Error(s) in loading state_dict for AlphaFold: Missing key(s) in state_dict: "aux_heads.tm.linear.weight", "aux_heads.tm.linear.bias". when I tried to use my own checkpoint after train OpenFold.

--openfold_checkpoint_path /checkpoints/14my.ckpt for running run_pretrained_openfold.py script

Who can explain me please how to solve this problem?

vetmax7 avatar Mar 07 '24 05:03 vetmax7