From 27bb0c8780ab59fb8bb318f210e978beb863b45e Mon Sep 17 00:00:00 2001 From: Boris Dayma Date: Thu, 16 Apr 2020 18:41:05 -0500 Subject: [PATCH 1/3] fix(wandb): allow use of sweeps overwrite run config parameters due to precision error fix #1290 --- pytorch_lightning/loggers/wandb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/loggers/wandb.py b/pytorch_lightning/loggers/wandb.py index 8d4bd0aa4a355..3e8443056c722 100644 --- a/pytorch_lightning/loggers/wandb.py +++ b/pytorch_lightning/loggers/wandb.py @@ -114,7 +114,7 @@ def watch(self, model: nn.Module, log: str = 'gradients', log_freq: int = 100): @rank_zero_only def log_hyperparams(self, params: Union[Dict[str, Any], Namespace]) -> None: params = self._convert_params(params) - self.experiment.config.update(params) + self.experiment.config.update(params, allow_val_change=True) @rank_zero_only def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None) -> None: From 9621435cb22596c9b59a34ff72200121a0fd5722 Mon Sep 17 00:00:00 2001 From: Boris Dayma Date: Thu, 16 Apr 2020 18:44:50 -0500 Subject: [PATCH 2/3] docs(wandb): update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff333c0fcabb8..ebc079e0ee2c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added a missing call to the `on_before_zero_grad` model hook ([#1493](https://github.com/PyTorchLightning/pytorch-lightning/pull/1493)). -- +- Allow use of sweeps with WandbLogger ([#1512](https://github.com/PyTorchLightning/pytorch-lightning/pull/1512)) ## [0.7.3] - 2020-04-09 From 48a593aea2995628fe9361ff3c5196fe6de8cf2d Mon Sep 17 00:00:00 2001 From: Boris Dayma Date: Thu, 16 Apr 2020 19:04:31 -0500 Subject: [PATCH 3/3] test(wandb): update config test --- tests/loggers/test_wandb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/loggers/test_wandb.py b/tests/loggers/test_wandb.py index 87240ac3edb70..d2ef6318c8c14 100644 --- a/tests/loggers/test_wandb.py +++ b/tests/loggers/test_wandb.py @@ -23,7 +23,7 @@ def test_wandb_logger(wandb): wandb.init().log.assert_called_once_with({'global_step': 3, 'acc': 1.0}) logger.log_hyperparams({'test': None}) - wandb.init().config.update.assert_called_once_with({'test': None}) + wandb.init().config.update.assert_called_once_with({'test': None}, allow_val_change=True) logger.watch('model', 'log', 10) wandb.init().watch.assert_called_once_with('model', log='log', log_freq=10)