Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[fbcode] Fix bug with internal tensorboard #3637

Merged
merged 1 commit into from
May 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions parlai/core/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down