From a375240c0c88e83a4e160f2685a189fe51830656 Mon Sep 17 00:00:00 2001 From: Skyy93 Date: Fri, 15 Jan 2021 06:28:58 +0100 Subject: [PATCH] Tensorboard Docu about Hyperparams saving (#5158) * Add documentation to tensorboard * Remove unnecessary whitespaces * Update pytorch_lightning/loggers/tensorboard.py Co-authored-by: Jirka Borovec * Add metrics to tensorboard logger * Whitespace removed Co-authored-by: Jirka Borovec --- pytorch_lightning/loggers/tensorboard.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/loggers/tensorboard.py b/pytorch_lightning/loggers/tensorboard.py index 5e148b09f5..869ec09fa7 100644 --- a/pytorch_lightning/loggers/tensorboard.py +++ b/pytorch_lightning/loggers/tensorboard.py @@ -144,8 +144,21 @@ class TensorBoardLogger(LightningLoggerBase): return self._experiment @rank_zero_only - def log_hyperparams(self, params: Union[Dict[str, Any], Namespace], - metrics: Optional[Dict[str, Any]] = None) -> None: + def log_hyperparams( + self, + params: Union[Dict[str, Any], Namespace], + metrics: Optional[Dict[str, Any]] = None, + ) -> None: + """ + Record hyperparameters. TensorBoard logs with and without saved hyperparameters + are incompatible, the hyperparameters are then not displayed in the TensorBoard. + Please delete or move the previously saved logs to display the new ones with hyperparameters. + + Args: + params: a dictionary-like container with the hyperparameters + metrics: Dictionary with metric names as keys and measured quantities as values + """ + params = self._convert_params(params) # store params to output