From e2f10432a232750b8f9120f3b81758bd6c21346d 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 a8aa766fe..80c4db75e 100644 --- a/stable_baselines3/common/logger.py +++ b/stable_baselines3/common/logger.py @@ -427,6 +427,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.add_scalar(k, v) # Flush the output to the file self.writer.flush()