Skip to content

set_weights error: mismatch between model architecture and loaded weights (500 vs 706) #2

@KARENLHAO

Description

@KARENLHAO

I encountered a TensorFlow/Keras weight-loading error when running the Joint / Stability design workflow. The program fails during model initialization with the following error:

Traceback (most recent call last):
  File "/data/PRG/tools/Biomolecules/apps/Joint_Model_Stability/design_models/joint_models.py", line 155, in <module>
    main()
  File "/data/PRG/tools/Biomolecules/apps/Joint_Model_Stability/design_models/joint_models.py", line 143, in main
    new_seq, identity = design_single_pdb(args.pdb)
  File "/data/PRG/tools/Biomolecules/apps/Joint_Model_Stability/design_models/joint_models.py", line 94, in design_single_pdb
    seqid=1.0,
  File "/data/PRG/tools/Biomolecules/apps/Joint_Model_Stability/design_models/design_models.py", line 426, in design
    sample=sample, temp=temp, hard=hard, train=True, seqid=seqid)
  File "/data/PRG/tools/Biomolecules/apps/Joint_Model_Stability/design_models/design_models.py", line 487, in predict
    self.model.set_weights(model_weights)
  File "/data/PRG/tools/Biomolecules/miniconda3/envs/joint_design/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 1332, in set_weights
    str(weights)[:50] + '...')
ValueError: You called `set_weights(weights)` on layer "model_2" with a  weight list of length 500, but the layer was expecting 706 weights. Provided weights: [array([[ 0.04451174,  0.03984993,  0.04551939, .....

If helpful, I can provide additional details such as:

  • the exact commit / branch used

  • the source and name of the weight file

  • the command and arguments used to run the script

Thank you very much for your time and for maintaining Joint_Model_Stability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions