From bff34fdf1393057a37f34fe077c9179ea472516a Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 18 Dec 2019 11:57:53 -0800 Subject: [PATCH] Fix AsyncCheckpointSaverHook info logging if listeners is None. PiperOrigin-RevId: 286237503 Change-Id: Ib77a42b8f22f142d15ef6f42135852a3c8188d53 --- tensorflow/python/tpu/async_checkpoint.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/tpu/async_checkpoint.py b/tensorflow/python/tpu/async_checkpoint.py index 3fcaa0c7f23..a32cdc5d75b 100644 --- a/tensorflow/python/tpu/async_checkpoint.py +++ b/tensorflow/python/tpu/async_checkpoint.py @@ -65,8 +65,10 @@ class AsyncCheckpointSaverHook(basic_session_run_hooks.CheckpointSaverHook): ValueError: At most one of `saver` or `scaffold` should be set. """ save_path = os.path.join(checkpoint_dir, checkpoint_basename) - logging.info("Create AsyncCheckpointSaverHook saving to path\n%s\n" - "with %d listener(s).", save_path, len(listeners)) + logging.info("Create AsyncCheckpointSaverHook saving to path\n%s", + save_path) + if listeners: + logging.info(" with %d listener(s).", len(listeners)) if saver is not None and scaffold is not None: raise ValueError("You cannot provide both saver and scaffold.") self._saver = saver