From e33a95638120e8d5fe93b8049cb937995bd32833 Mon Sep 17 00:00:00 2001 From: Bilal Khan <29356759+bkkaggle@users.noreply.github.com> Date: Wed, 18 Mar 2020 20:06:22 -0500 Subject: [PATCH 1/5] Replace Wandb callback's finalize with no-op --- pytorch_lightning/loggers/wandb.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pytorch_lightning/loggers/wandb.py b/pytorch_lightning/loggers/wandb.py index 0c4e24d80a49d..bdb21bb9a2834 100644 --- a/pytorch_lightning/loggers/wandb.py +++ b/pytorch_lightning/loggers/wandb.py @@ -102,11 +102,7 @@ def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None): @rank_zero_only def finalize(self, status: str = 'success'): - try: - exit_code = 0 if status == 'success' else 1 - wandb.join(exit_code) - except TypeError: - wandb.join() + return 0 @property def name(self) -> str: From 2de509376bf4792c95237ab6cd1bbc268dd7152d Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 25 Mar 2020 10:44:43 +0100 Subject: [PATCH 2/5] Update pytorch_lightning/loggers/wandb.py --- 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 2d1e7d5da97ec..9ddd491c91635 100644 --- a/pytorch_lightning/loggers/wandb.py +++ b/pytorch_lightning/loggers/wandb.py @@ -108,7 +108,7 @@ def finalize(self, status: str = 'success') -> None: wandb.join(exit_code) except TypeError: wandb.join() - return exit_code + return exit_code @property def name(self) -> str: From a681ae7ca3ea490145ee37cabe172e55ac70a145 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 25 Mar 2020 15:44:09 +0100 Subject: [PATCH 3/5] Update wandb.py --- pytorch_lightning/loggers/wandb.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pytorch_lightning/loggers/wandb.py b/pytorch_lightning/loggers/wandb.py index 9ddd491c91635..bfaf9f185acf0 100644 --- a/pytorch_lightning/loggers/wandb.py +++ b/pytorch_lightning/loggers/wandb.py @@ -103,12 +103,7 @@ def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None) -> @rank_zero_only def finalize(self, status: str = 'success') -> None: - try: - exit_code = 0 if status == 'success' else 1 - wandb.join(exit_code) - except TypeError: - wandb.join() - return exit_code + return 0 @property def name(self) -> str: From 7f67a53251da6bfd68251c6e3dc6ae38eb26096a Mon Sep 17 00:00:00 2001 From: Bilal Khan Date: Sun, 29 Mar 2020 19:30:07 -0500 Subject: [PATCH 4/5] remove wandb logger's finalize and update tests --- pytorch_lightning/loggers/wandb.py | 4 ---- tests/loggers/test_wandb.py | 14 -------------- 2 files changed, 18 deletions(-) diff --git a/pytorch_lightning/loggers/wandb.py b/pytorch_lightning/loggers/wandb.py index bfaf9f185acf0..e11f5139ca2a2 100644 --- a/pytorch_lightning/loggers/wandb.py +++ b/pytorch_lightning/loggers/wandb.py @@ -101,10 +101,6 @@ def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None) -> metrics['global_step'] = step self.experiment.log(metrics) - @rank_zero_only - def finalize(self, status: str = 'success') -> None: - return 0 - @property def name(self) -> str: return self.experiment.project_name() diff --git a/tests/loggers/test_wandb.py b/tests/loggers/test_wandb.py index abb49544b1ade..dadc225aa8447 100644 --- a/tests/loggers/test_wandb.py +++ b/tests/loggers/test_wandb.py @@ -30,20 +30,6 @@ def test_wandb_logger(wandb): logger.watch('model', 'log', 10) wandb.watch.assert_called_once_with('model', log='log', log_freq=10) - logger.finalize('fail') - wandb.join.assert_called_once_with(1) - - wandb.join.reset_mock() - logger.finalize('success') - wandb.join.assert_called_once_with(0) - - wandb.join.reset_mock() - wandb.join.side_effect = TypeError - with pytest.raises(TypeError): - logger.finalize('any') - - wandb.join.assert_called() - assert logger.name == wandb.init().project_name() assert logger.version == wandb.init().id From 4cd5bab20890e5ac835bd717a65bc95f8de5dbf4 Mon Sep 17 00:00:00 2001 From: Bilal Khan Date: Sun, 29 Mar 2020 19:31:14 -0500 Subject: [PATCH 5/5] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c948e22e7b553..f9c7ae7f804a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Removed - Removed duplicated module `pytorch_lightning.utilities.arg_parse` for loading CLI arguments ([#1167](https://github.com/PyTorchLightning/pytorch-lightning/issues/1167)) +- Removed wandb logger's finalize ([#1193](https://github.com/PyTorchLightning/pytorch-lightning/pull/1193)) ### Fixed