From 9f9af85a2adce2982eb930ee9063f501656a4e56 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Wed, 19 Apr 2023 15:06:10 +0300 Subject: [PATCH] Fix TensorBoard negative iterations were zeroed --- clearml/binding/frameworks/tensorflow_bind.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clearml/binding/frameworks/tensorflow_bind.py b/clearml/binding/frameworks/tensorflow_bind.py index 02c2766b..fa0ac995 100644 --- a/clearml/binding/frameworks/tensorflow_bind.py +++ b/clearml/binding/frameworks/tensorflow_bind.py @@ -727,12 +727,14 @@ class EventTrainsWriter(object): # unlike other frameworks, tensorflow already accounts for the iteration number # when continuing the training. we substract the smallest iteration such that we # don't increment the step twice number + original_step = step if EventTrainsWriter._current_task: step -= EventTrainsWriter._current_task.get_initial_iteration() # there can be a few metrics getting reported again, so the step can be negative # for the first few reports - if step < 0: + if step < 0 and original_step > 0: step = 0 + self._max_step = max(self._max_step, step) if value_dicts is None: LoggerRoot.get_base_logger(TensorflowBinding).debug("Summary arrived without 'value'")