Skip to content

Commit a79d774

Browse files
chizuchizuakihironittacarmoccarohitgr7
authored andcommitted
Fix AttributeError: 'NoneType' object has no attribute 'finalize' on TPU (#6221)
* Fix bug Fix AttributeError: 'NoneType' object has no attribute 'finalize' * Update CHANGELOG.md * deleted a period * Update CHANGELOG.md Co-authored-by: Akihiro Nitta <[email protected]> * Update CHANGELOG.md * Update pytorch_lightning/plugins/training_type/tpu_spawn.py Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Akihiro Nitta <[email protected]> Co-authored-by: Carlos Mocholí <[email protected]> Co-authored-by: Rohit Gupta <[email protected]>
1 parent 5f9bb9d commit a79d774

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
1818
- Fixed `ModelPruning(make_pruning_permanent=True)` pruning buffers getting removed when saved during training ([#6073](https://github.com/PyTorchLightning/pytorch-lightning/pull/6073))
1919

2020

21+
- Fixed `AttributeError` when `logger=None` on TPU ([#6221](https://github.com/PyTorchLightning/pytorch-lightning/pull/6221))
22+
23+
2124

2225
## [1.2.2] - 2021-03-02
2326

pytorch_lightning/plugins/training_type/tpu_spawn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def __load_weights_on_main_process(self) -> None:
234234
self._model = model
235235

236236
def _close_logger(self, trainer) -> None:
237-
if hasattr(trainer, "logger"):
237+
if trainer.logger is not None:
238238
trainer.logger.finalize("success")
239239

240240
@property

0 commit comments

Comments
 (0)