mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-10 12:21:57 +08:00
Create single file in TensorBoardLogger (#777)
* write to single file * fix import
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user