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:
parent
35ac30e688
commit
5f292390fd
|
@ -115,6 +115,7 @@ class TensorBoardLogger(LightningLoggerBase):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
from torch.utils.tensorboard.summary import hparams
|
from torch.utils.tensorboard.summary import hparams
|
||||||
|
|
||||||
if metrics is None:
|
if metrics is None:
|
||||||
metrics = {}
|
metrics = {}
|
||||||
exp, ssi, sei = hparams(sanitized_params, metrics)
|
exp, ssi, sei = hparams(sanitized_params, metrics)
|
||||||
|
@ -123,6 +124,10 @@ class TensorBoardLogger(LightningLoggerBase):
|
||||||
writer.add_summary(ssi)
|
writer.add_summary(ssi)
|
||||||
writer.add_summary(sei)
|
writer.add_summary(sei)
|
||||||
|
|
||||||
|
if metrics:
|
||||||
|
# necessary for hparam comparison with metrics
|
||||||
|
self.log_metrics(metrics)
|
||||||
|
|
||||||
# some alternative should be added
|
# some alternative should be added
|
||||||
self.tags.update(sanitized_params)
|
self.tags.update(sanitized_params)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue