Skip to content

Commit a707d4b

Browse files
bilal2vecBordawilliamFalcon
authored
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 <[email protected]> Co-authored-by: William Falcon <[email protected]>
1 parent 2ccc745 commit a707d4b

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3232
### Removed
3333

3434
- Removed duplicated module `pytorch_lightning.utilities.arg_parse` for loading CLI arguments ([#1167](https://github.com/PyTorchLightning/pytorch-lightning/issues/1167))
35+
- Removed wandb logger's finalize ([#1193](https://github.com/PyTorchLightning/pytorch-lightning/pull/1193))
3536
- Dropped `torchvision` dependency in tests and added own MNIST dataset class instead ([#986](https://github.com/PyTorchLightning/pytorch-lightning/issues/986))
3637

3738
### Fixed

pytorch_lightning/loggers/wandb.py

-8
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None) ->
101101
metrics['global_step'] = step
102102
self.experiment.log(metrics)
103103

104-
@rank_zero_only
105-
def finalize(self, status: str = 'success') -> None:
106-
try:
107-
exit_code = 0 if status == 'success' else 1
108-
wandb.join(exit_code)
109-
except TypeError:
110-
wandb.join()
111-
112104
@property
113105
def name(self) -> str:
114106
return self.experiment.project_name()

tests/loggers/test_wandb.py

-14
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,6 @@ def test_wandb_logger(wandb):
3030
logger.watch('model', 'log', 10)
3131
wandb.watch.assert_called_once_with('model', log='log', log_freq=10)
3232

33-
logger.finalize('fail')
34-
wandb.join.assert_called_once_with(1)
35-
36-
wandb.join.reset_mock()
37-
logger.finalize('success')
38-
wandb.join.assert_called_once_with(0)
39-
40-
wandb.join.reset_mock()
41-
wandb.join.side_effect = TypeError
42-
with pytest.raises(TypeError):
43-
logger.finalize('any')
44-
45-
wandb.join.assert_called()
46-
4733
assert logger.name == wandb.init().project_name()
4834
assert logger.version == wandb.init().id
4935

0 commit comments

Comments
 (0)