From bed8f48ec08427b9bc5149860cec080a47093e35 Mon Sep 17 00:00:00 2001 From: Ruggero Nocera <9341160+rogierz@users.noreply.github.com> Date: Thu, 26 Jan 2023 12:47:11 +0100 Subject: [PATCH] Added missing metrics when logging on tensorboard (#1298) Co-authored-by: Riccardo Sepe Co-authored-by: Francesco Scalera --- stable_baselines3/common/logger.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stable_baselines3/common/logger.py b/stable_baselines3/common/logger.py index 939d924957..2a730b4110 100644 --- a/stable_baselines3/common/logger.py +++ b/stable_baselines3/common/logger.py @@ -430,6 +430,8 @@ def write(self, key_values: Dict[str, Any], key_excluded: Dict[str, Union[str, T self.writer.file_writer.add_summary(experiment) self.writer.file_writer.add_summary(session_start_info) self.writer.file_writer.add_summary(session_end_info) + for k, v in value.metric_dict.items(): + self.writer.file_writer.add_scalar(k, v) # Flush the output to the file self.writer.flush()