Skip to content

Commit

Permalink
Fixed saved file namespace.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 564423073
  • Loading branch information
fchollet authored and tensorflower-gardener committed Sep 11, 2023
1 parent c5eb85b commit 560dc83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions keras/saving/saving_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"_callable_losses",
"_captured_weight_regularizer",
"_checkpoint_dependencies",
"_layer_checkpoint_dependencies",
"_deferred_dependencies",
"_eager_losses",
"_inbound_nodes",
Expand All @@ -71,7 +72,6 @@
"_keras_api_names",
"_keras_api_names_v1",
"_name_based_restores",
"_non_trainable_weights",
"_outbound_nodes",
"_outbound_nodes_value",
"_saved_model_arg_spec",
Expand Down Expand Up @@ -364,7 +364,7 @@ def _write_to_zip_recursively(zipfile_to_save, system_path, zip_path):


def _walk_trackable(trackable):
for child_attr in dir(trackable):
for child_attr in sorted(dir(trackable), reverse=True):
if child_attr.startswith("__") or child_attr in ATTR_SKIPLIST:
continue
try:
Expand Down
2 changes: 1 addition & 1 deletion keras/saving/saving_lib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ def test_layer_index_naming(self):
model.save_weights(weights_filepath)
with h5py.File(weights_filepath, "r") as f:
self.assertAllEqual(
list(f["_layer_checkpoint_dependencies"].keys()),
list(f["layers"].keys()),
["dense", "dense_1", "dense_2", "dense_3"],
)

Expand Down

0 comments on commit 560dc83

Please sign in to comment.