Create single file in TensorBoardLogger (#777)

* write to single file

* fix import
This commit is contained in:
Dmitry Lipin
2020-02-02 09:31:45 -05:00
committed by GitHub
parent 472f394788
commit b5cab7e0f5
+6 -2
View File
@@ -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)