From 06391e0802c72219ad86e5f8b3175f039c7f08c0 Mon Sep 17 00:00:00 2001 From: Matt Watson Date: Fri, 29 Mar 2024 22:14:28 -0700 Subject: [PATCH] Remove dead code in saving lib --- keras/saving/saving_lib.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/keras/saving/saving_lib.py b/keras/saving/saving_lib.py index 52fcb6601af..1054f69cab9 100644 --- a/keras/saving/saving_lib.py +++ b/keras/saving/saving_lib.py @@ -237,7 +237,6 @@ def load_weights_only(model, filepath, skip_mismatch=False): Note: only supports h5 for now. """ - temp_dir = None archive = None filepath = str(filepath) if filepath.endswith(".weights.h5"): @@ -262,8 +261,6 @@ def load_weights_only(model, filepath, skip_mismatch=False): error_msgs=error_msgs, ) weights_store.close() - if temp_dir and file_utils.exists(temp_dir): - file_utils.rmtree(temp_dir) if archive: archive.close()