From ca87ec3b91a5c100fd98f0b0d8e9c1d9aa05876c Mon Sep 17 00:00:00 2001 From: Stephen Roller Date: Fri, 30 Apr 2021 06:58:57 -0400 Subject: [PATCH] [fbcode] Fix bug with internal tensorboard --- parlai/core/logs.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/parlai/core/logs.py b/parlai/core/logs.py index 066e52ba661..7609ea8d493 100644 --- a/parlai/core/logs.py +++ b/parlai/core/logs.py @@ -92,13 +92,17 @@ def log_metrics(self, setting, step, report): logging.error(f'k {k} v {v} is not a number') continue display = get_metric_display_data(metric=k) - self.writer.add_scalar( - f'{k}/{setting}', - v, - global_step=step, - display_name=f"{display.title}", - summary_description=display.description, - ) + try: + self.writer.add_scalar( + f'{k}/{setting}', + v, + global_step=step, + display_name=f"{display.title}", + summary_description=display.description, + ) + except TypeError: + # internal tensorboard doesn't support custom display titles etc + self.writer.add_scalar(f'{k}/{setting}', v, global_step=step) def flush(self): self.writer.flush()