From 98fcc1713542c64ff3ac6a7a1dc2b673f35bb1f9 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Fri, 26 Jul 2019 08:27:14 -0400 Subject: [PATCH] Update trainer.py --- pytorch_lightning/models/trainer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/models/trainer.py b/pytorch_lightning/models/trainer.py index c21cf3be01..9c7545103d 100644 --- a/pytorch_lightning/models/trainer.py +++ b/pytorch_lightning/models/trainer.py @@ -612,8 +612,9 @@ class Trainer(TrainerIO): # run all epochs for epoch_nb in range(self.current_epoch, self.max_nb_epochs): # update the lr scheduler - for lr_scheduler in self.lr_schedulers: - lr_scheduler.step() + if self.lr_schedulers is not None: + for lr_scheduler in self.lr_schedulers: + lr_scheduler.step() model = self.__get_model() model.current_epoch = epoch_nb