From fa1f5b508598f1d488fcd4a622007c3491597b3f Mon Sep 17 00:00:00 2001 From: Bilal Khan <29356759+bkkaggle@users.noreply.github.com> Date: Mon, 30 Mar 2020 17:45:06 -0500 Subject: [PATCH] Replace Wandb callback's finalize with no-op (#1193) * Replace Wandb callback's finalize with no-op * Update pytorch_lightning/loggers/wandb.py * Update wandb.py * remove wandb logger's finalize and update tests * update changelog Co-authored-by: Jirka Borovec Co-authored-by: William Falcon --- CHANGELOG.md | 1 + pytorch_lightning/loggers/wandb.py | 8 -------- tests/loggers/test_wandb.py | 14 -------------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1610641a7c2be..2d15a0a88d075 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,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)) - Dropped `torchvision` dependency in tests and added own MNIST dataset class instead ([#986](https://github.com/PyTorchLightning/pytorch-lightning/issues/986)) ### Fixed diff --git a/pytorch_lightning/loggers/wandb.py b/pytorch_lightning/loggers/wandb.py index f52cf945e1f6d..e11f5139ca2a2 100644 --- a/pytorch_lightning/loggers/wandb.py +++ b/pytorch_lightning/loggers/wandb.py @@ -101,14 +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: - try: - exit_code = 0 if status == 'success' else 1 - wandb.join(exit_code) - except TypeError: - wandb.join() - @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 8e9d6c49b7165..774f722ce43d0 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