From 6c96e6017403d4b3f991f7401e68c9aa71d55aa5 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Mon, 20 Sep 2021 22:56:44 +0300 Subject: [PATCH] Fix images reported over history size were not sent if frequency was too high --- clearml/backend_interface/metrics/events.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/clearml/backend_interface/metrics/events.py b/clearml/backend_interface/metrics/events.py index d1bedce8..4ac3ec96 100644 --- a/clearml/backend_interface/metrics/events.py +++ b/clearml/backend_interface/metrics/events.py @@ -12,7 +12,7 @@ from PIL import Image from six.moves.urllib.parse import urlparse, urlunparse from ...backend_api.services import events -from ...config import config, deferred_config +from ...config import deferred_config from ...storage.util import quote_url from ...utilities.attrs import attrs from ...utilities.process.mp import SingletonLock @@ -288,11 +288,16 @@ class UploadEvent(MetricsEventAdapter): def get_file_entry(self): local_file = None - # don't provide file in case this event is out of the history window - last_count = self._get_metric_count(self.metric, self.variant, next=False) - if abs(self._count - last_count) > int(self._file_history_size): - output = None - elif isinstance(self._image_data, (six.StringIO, six.BytesIO)): + + # Notice that in case we are running with reporter in subprocess, + # when we are here, the cls._metric_counters is actually empty, + # since it was updated on the main process and this function is running from the subprocess. + # + # In the future, if we want to support multi processes reporting images with the same title/series, + # we should move the _count & _filename selection into the subprocess, not the main process. + # For the time being, this will remain a limitation of the Image reporting mechanism. + + if isinstance(self._image_data, (six.StringIO, six.BytesIO)): output = self._image_data elif self._image_data is not None: image_data = self._image_data