From 61144edbf9314250f3a02fec1862fc19c6011656 Mon Sep 17 00:00:00 2001 From: Ye Huang Date: Sat, 23 Nov 2024 04:11:30 +0800 Subject: [PATCH] FIX BUG in load_weights_from_hdf5_group_by_name" legacy_h5_format.py --- keras/src/legacy/saving/legacy_h5_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras/src/legacy/saving/legacy_h5_format.py b/keras/src/legacy/saving/legacy_h5_format.py index 0e284f5a9db..cc5ef63d97a 100644 --- a/keras/src/legacy/saving/legacy_h5_format.py +++ b/keras/src/legacy/saving/legacy_h5_format.py @@ -519,7 +519,7 @@ def load_weights_from_hdf5_group_by_name(f, model, skip_mismatch=False): ) if "top_level_model_weights" in f: - symbolic_weights = model.trainable_weights + model.non_trainable_weights + symbolic_weights = model._trainable_variables + model._non_trainable_variables weight_values = load_subset_weights_from_hdf5_group( f["top_level_model_weights"] )