From e7c12d936e30aec96b1bf333ed9dc17c736dcc9e Mon Sep 17 00:00:00 2001 From: Hata Ryosuke Date: Wed, 23 Oct 2019 02:07:48 +0900 Subject: [PATCH] fixed bag callback=False or None at trainer_io.py (#409) --- pytorch_lightning/trainer/trainer_io.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pytorch_lightning/trainer/trainer_io.py b/pytorch_lightning/trainer/trainer_io.py index d1c9976781..c19dfedcef 100644 --- a/pytorch_lightning/trainer/trainer_io.py +++ b/pytorch_lightning/trainer/trainer_io.py @@ -151,10 +151,10 @@ class TrainerIOMixin(object): 'global_step': self.global_step } - if self.checkpoint_callback is not None or self.checkpoint_callback is not False: + if self.checkpoint_callback is not None and self.checkpoint_callback is not False: checkpoint['checkpoint_callback_best'] = self.checkpoint_callback.best - if self.early_stop_callback is not None or self.checkpoint_callback is not False: + if self.early_stop_callback is not None and self.checkpoint_callback is not False: checkpoint['early_stop_callback_wait'] = self.early_stop_callback.wait checkpoint['early_stop_callback_patience'] = self.early_stop_callback.patience @@ -207,10 +207,10 @@ class TrainerIOMixin(object): :param checkpoint: :return: """ - if self.checkpoint_callback is not None or self.checkpoint_callback is not False: + if self.checkpoint_callback is not None and self.checkpoint_callback is not False: self.checkpoint_callback.best = checkpoint['checkpoint_callback_best'] - if self.early_stop_callback is not None or self.early_stop_callback is not False: + if self.early_stop_callback is not None and self.early_stop_callback is not False: self.early_stop_callback.wait = checkpoint['early_stop_callback_wait'] self.early_stop_callback.patience = checkpoint['early_stop_callback_patience']