### restore model ###
# note: run %%bash get_model.sh
# if you have not already downloaded the model
seqnn_model.restore(model_file)
print('successfully loaded')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[13], line 4
1 ### restore model ###
2 # note: run %%bash get_model.sh
3 # if you have not already downloaded the model
----> 4 seqnn_model.restore(model_file)
5 print('successfully loaded')
File /home/groups/hoolock2/u0/jvc/AKITA-POC/basenji/basenji/seqnn.py:807, in SeqNN.restore(self, model_file, head_i, trunk)
805 self.model_trunk.load_weights(model_file)
806 else:
--> 807 self.models[head_i].load_weights(model_file)
808 self.model = self.models[head_i]
File /home/groups/hoolock2/u0/jvc/miniconda3/envs/basenji/lib/python3.8/site-packages/keras/src/utils/traceback_utils.py:70, in filter_traceback.<locals>.error_handler(*args, **kwargs)
67 filtered_tb = _process_traceback_frames(e.__traceback__)
68 # To get the full stack trace, call:
69 # `tf.debugging.disable_traceback_filtering()`
---> 70 raise e.with_traceback(filtered_tb) from None
71 finally:
72 del filtered_tb
File /home/groups/hoolock2/u0/jvc/miniconda3/envs/basenji/lib/python3.8/site-packages/keras/src/saving/legacy/hdf5_format.py:834, in load_weights_from_hdf5_group(f, model)
830 weight_values = preprocess_weights_for_loading(
831 layer, weight_values, original_keras_version, original_backend
832 )
833 if len(weight_values) != len(symbolic_weights):
--> 834 raise ValueError(
835 f"Weight count mismatch for layer #{k} (named {layer.name} in "
836 f"the current model, {name} in the save file). "
837 f"Layer expects {len(symbolic_weights)} weight(s). Received "
838 f"{len(weight_values)} saved weight(s)"
839 )
840 weight_value_tuples += zip(symbolic_weights, weight_values)
842 if "top_level_model_weights" in f:
ValueError: Weight count mismatch for layer #94 (named squeeze_excite_5 in the current model, squeeze_excite in the save file). Layer expects 4 weight(s). Received 8 saved weight(s)
I am trying to run the code from evaluate_models on the newer models described here: https://github.com/calico/basenji/blob/master/manuscripts/akita/v2/README.md
I am getting weights mismatch error when loading the model: