mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
Bug fix hparam logging with metrics (#1647)
* add metric logging * Use pytorch built-in method * Update tensorboard.py * Update tensorboard.py
This commit is contained in:
@@ -115,6 +115,7 @@ class TensorBoardLogger(LightningLoggerBase):
|
||||
)
|
||||
else:
|
||||
from torch.utils.tensorboard.summary import hparams
|
||||
|
||||
if metrics is None:
|
||||
metrics = {}
|
||||
exp, ssi, sei = hparams(sanitized_params, metrics)
|
||||
@@ -123,6 +124,10 @@ class TensorBoardLogger(LightningLoggerBase):
|
||||
writer.add_summary(ssi)
|
||||
writer.add_summary(sei)
|
||||
|
||||
if metrics:
|
||||
# necessary for hparam comparison with metrics
|
||||
self.log_metrics(metrics)
|
||||
|
||||
# some alternative should be added
|
||||
self.tags.update(sanitized_params)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user