From aee36dd36fc103cf4b8675c52249c4516f59b532 Mon Sep 17 00:00:00 2001
From: Michael <m.langguth@fz-juelich.de>
Date: Fri, 13 Aug 2021 10:42:44 +0200
Subject: [PATCH] Add print-statement to identify checkpoint that is restored.

---
 .../model_modules/video_prediction/utils/tf_utils.py          | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/video_prediction_tools/model_modules/video_prediction/utils/tf_utils.py b/video_prediction_tools/model_modules/video_prediction/utils/tf_utils.py
index 7a1da880..415275e8 100644
--- a/video_prediction_tools/model_modules/video_prediction/utils/tf_utils.py
+++ b/video_prediction_tools/model_modules/video_prediction/utils/tf_utils.py
@@ -526,10 +526,14 @@ def reduce_tensors(structures, shallow=False):
 
 def get_checkpoint_restore_saver(checkpoint, var_list=None, skip_global_step=False, restore_to_checkpoint_mapping=None):
 
+    method = get_checkpoint_restore_saver.__name__
 
     if os.path.isdir(checkpoint):
         # latest_checkpoint doesn't work when the path has special characters
         checkpoint = tf.train.latest_checkpoint(checkpoint)
+    # print name of checkpoint-file for verbosity
+    print("%{0}: The follwoing checkpoint is used for restoring the model: '{1}'".format(method, checkpoint))
+    # Start processing the checkpoint
     checkpoint_reader = tf.pywrap_tensorflow.NewCheckpointReader(checkpoint)
     checkpoint_var_names = checkpoint_reader.get_variable_to_shape_map().keys()
     restore_to_checkpoint_mapping = restore_to_checkpoint_mapping or (lambda name, _: name.split(':')[0])
-- 
GitLab