mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-11 12:31:23 +08:00
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 <Borda@users.noreply.github.com> Co-authored-by: William Falcon <waf2107@columbia.edu>
This commit is contained in:
co-authored by
Jirka Borovec
William Falcon
parent
2ccc7456ca
commit
a707d4bea1
@@ -32,6 +32,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
|
||||
|
||||
@@ -101,14 +101,6 @@ class WandbLogger(LightningLoggerBase):
|
||||
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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user