From 8be002ccc7c2e8371ab426ea07c953f72747269e Mon Sep 17 00:00:00 2001 From: Lezwon Castelino Date: Thu, 1 Oct 2020 16:27:26 +0530 Subject: [PATCH] skip best_model_path if checkpoint_callback is None (#2962) * skip best_model_path if checkpoint_callback is None * removed test --- pytorch_lightning/accelerators/tpu_backend.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/accelerators/tpu_backend.py b/pytorch_lightning/accelerators/tpu_backend.py index dbf13c3434..043c6b1e5c 100644 --- a/pytorch_lightning/accelerators/tpu_backend.py +++ b/pytorch_lightning/accelerators/tpu_backend.py @@ -67,7 +67,8 @@ class TPUBackend(Accelerator): last_path = self.mp_queue.get() # transfer back the best path to the trainer - self.trainer.checkpoint_callback.best_model_path = best_path + if self.trainer.checkpoint_callback is not None: + self.trainer.checkpoint_callback.best_model_path = best_path # todo, pass also bets score # load last weights