From 66dae87c67bbf8d832fbfdca4d0b00e32c1137c5 Mon Sep 17 00:00:00 2001 From: chizuchizu <44621609+Chizuchizu@users.noreply.github.com> Date: Fri, 26 Feb 2021 21:32:34 +0900 Subject: [PATCH 1/6] Fix bug Fix AttributeError: 'NoneType' object has no attribute 'finalize' --- pytorch_lightning/plugins/training_type/tpu_spawn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/plugins/training_type/tpu_spawn.py b/pytorch_lightning/plugins/training_type/tpu_spawn.py index 4232cba485414..7f44e357219a9 100644 --- a/pytorch_lightning/plugins/training_type/tpu_spawn.py +++ b/pytorch_lightning/plugins/training_type/tpu_spawn.py @@ -247,7 +247,7 @@ def __load_weights_on_main_process(self) -> None: self._model = model def _close_logger(self, trainer) -> None: - if hasattr(trainer, "logger"): + if hasattr(trainer, "logger.finalize"): trainer.logger.finalize("success") @property From db159b3ee3b65547dfd056114ea8cd4b93ede708 Mon Sep 17 00:00:00 2001 From: chizuchizu <44621609+Chizuchizu@users.noreply.github.com> Date: Fri, 26 Feb 2021 22:10:10 +0900 Subject: [PATCH 2/6] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e1d4b1d6c983..dc735bd01e9e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed multiple early stopping callbacks ([#6197](https://github.com/PyTorchLightning/pytorch-lightning/pull/6197)) +- Fixed a bug regarding logger on TPU. ([#6221](https://github.com/PyTorchLightning/pytorch-lightning/pull/6221)) + ## [1.2.1] - 2021-02-23 From 3507ed0959223e3aa60226ee74a8deeac89eab6a Mon Sep 17 00:00:00 2001 From: chizuchizu <44621609+Chizuchizu@users.noreply.github.com> Date: Fri, 26 Feb 2021 22:23:41 +0900 Subject: [PATCH 3/6] deleted a period --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc735bd01e9e8..5c5422923d2c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed multiple early stopping callbacks ([#6197](https://github.com/PyTorchLightning/pytorch-lightning/pull/6197)) -- Fixed a bug regarding logger on TPU. ([#6221](https://github.com/PyTorchLightning/pytorch-lightning/pull/6221)) +- Fixed a bug regarding logger on TPU ([#6221](https://github.com/PyTorchLightning/pytorch-lightning/pull/6221)) ## [1.2.1] - 2021-02-23 From 2a9751c71ef419353f67a5bdaae6195925cc5a4a Mon Sep 17 00:00:00 2001 From: chizuchizu <44621609+Chizuchizu@users.noreply.github.com> Date: Fri, 26 Feb 2021 22:54:55 +0900 Subject: [PATCH 4/6] Update CHANGELOG.md Co-authored-by: Akihiro Nitta --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c5422923d2c6..c9d0c10d2bd82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed multiple early stopping callbacks ([#6197](https://github.com/PyTorchLightning/pytorch-lightning/pull/6197)) -- Fixed a bug regarding logger on TPU ([#6221](https://github.com/PyTorchLightning/pytorch-lightning/pull/6221)) +- Fixed `AttributeError` when `logger=None` on TPU ([#6221](https://github.com/PyTorchLightning/pytorch-lightning/pull/6221)) ## [1.2.1] - 2021-02-23 From f23a52a9c7c0fde60250784b3a9f8a3c976a762c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Fri, 26 Feb 2021 17:26:54 +0100 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9d0c10d2bd82..b3134dce9e3e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed multiple early stopping callbacks ([#6197](https://github.com/PyTorchLightning/pytorch-lightning/pull/6197)) + - Fixed `AttributeError` when `logger=None` on TPU ([#6221](https://github.com/PyTorchLightning/pytorch-lightning/pull/6221)) From 556fc857da6ea8c52a6df14fccf2966342671996 Mon Sep 17 00:00:00 2001 From: chizuchizu <44621609+Chizuchizu@users.noreply.github.com> Date: Sat, 27 Feb 2021 15:39:53 +0900 Subject: [PATCH 6/6] Update pytorch_lightning/plugins/training_type/tpu_spawn.py Co-authored-by: Rohit Gupta --- pytorch_lightning/plugins/training_type/tpu_spawn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/plugins/training_type/tpu_spawn.py b/pytorch_lightning/plugins/training_type/tpu_spawn.py index 7f44e357219a9..ff92e1c698a50 100644 --- a/pytorch_lightning/plugins/training_type/tpu_spawn.py +++ b/pytorch_lightning/plugins/training_type/tpu_spawn.py @@ -247,7 +247,7 @@ def __load_weights_on_main_process(self) -> None: self._model = model def _close_logger(self, trainer) -> None: - if hasattr(trainer, "logger.finalize"): + if trainer.logger is not None: trainer.logger.finalize("success") @property