Update trainer.py

This commit is contained in:
William Falcon 2019-07-26 08:27:14 -04:00 committed by GitHub
parent 5ba0a8fe4c
commit 98fcc17135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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