From b5cab7e0f578dd0d034fb21d09ef9712cadd009c Mon Sep 17 00:00:00 2001 From: Dmitry Lipin Date: Sun, 2 Feb 2020 17:31:45 +0300 Subject: [PATCH] Create single file in TensorBoardLogger (#777) * write to single file * fix import --- pytorch_lightning/loggers/tensorboard.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/loggers/tensorboard.py b/pytorch_lightning/loggers/tensorboard.py index fb632b96ca..48459cd889 100644 --- a/pytorch_lightning/loggers/tensorboard.py +++ b/pytorch_lightning/loggers/tensorboard.py @@ -84,8 +84,12 @@ class TensorBoardLogger(LightningLoggerBase): " hyperparameter logging." ) else: - # `add_hparams` requires both - hparams and metric - self.experiment.add_hparams(hparam_dict=params, metric_dict={}) + from torch.utils.tensorboard.summary import hparams + exp, ssi, sei = hparams(params, {}) + writer = self.experiment._get_file_writer() + writer.add_summary(exp) + writer.add_summary(ssi) + writer.add_summary(sei) # some alternative should be added self.tags.update(params)