From 541c2425e0554a3718dda8de2b1f8421fa5176ba Mon Sep 17 00:00:00 2001 From: jday1 <45389553+jday1@users.noreply.github.com> Date: Sun, 19 Feb 2023 07:19:40 +0000 Subject: [PATCH 1/2] Fix debug samples are not uploaded correctly (#924) * PR relating to bug #923. --------- Co-authored-by: jday1 Co-authored-by: jday1 --- clearml/binding/frameworks/tensorflow_bind.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clearml/binding/frameworks/tensorflow_bind.py b/clearml/binding/frameworks/tensorflow_bind.py index b08b32e2..9d2aa9e9 100644 --- a/clearml/binding/frameworks/tensorflow_bind.py +++ b/clearml/binding/frameworks/tensorflow_bind.py @@ -398,11 +398,12 @@ class EventTrainsWriter(object): with open(fd, "wb") as f: f.write(imdata) return temp_file + image = np.asarray(im) output.close() if height is not None and height > 0 and width is not None and width > 0: - val = np.array(im).reshape((height, width, -1)).astype(np.uint8) + val = image.reshape((height, width, -1)).astype(np.uint8) else: - val = np.array(im).astype(np.uint8) + val = image.astype(np.uint8) if val.ndim == 3 and val.shape[2] == 3: if self._visualization_mode == 'BGR': val = val[:, :, [2, 1, 0]] From 4ebe714165cfdacdcc48b8cf6cc5bddb3c15a89f Mon Sep 17 00:00:00 2001 From: Make42 Date: Sun, 19 Feb 2023 08:25:24 +0100 Subject: [PATCH 2/2] Improve docstring for `Task.close()` (#920) --- clearml/task.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/clearml/task.py b/clearml/task.py index cd15fca2..561ded63 100644 --- a/clearml/task.py +++ b/clearml/task.py @@ -1724,9 +1724,14 @@ class Task(_Task): def close(self): """ - Closes the current Task and changes its status to completed. + Closes the current Task and changes its status to "Completed". Enables you to manually shutdown the task. - + This method does not terminate the current Python process, in contrast to :meth:`Task.mark_completed`. + + After having :meth:`Task.close`d a task, the respective object cannot be used anymore and + methods like :meth:`Task.connect` or :meth:`Task.connect_configuration` will throw a `ValueError`. + In order to obtain an object representing the task again, use methods like :meth:`Task.get_task`. + .. warning:: Only call :meth:`Task.close` if you are certain the Task is not needed. """