Skip to content

Commit

Permalink
Merge pull request #102 from hzdr-MedImaging/fix-NoneType-scheduler
Browse files Browse the repository at this point in the history
fix NoneType situation if lr_scheduler is disabled.
  • Loading branch information
wolny authored Dec 4, 2023
2 parents 725ca3a + 3f87e79 commit 85ae308
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pytorch3dunet/unet3d/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ def train(self):
# adjust learning rate if necessary
if isinstance(self.scheduler, ReduceLROnPlateau):
self.scheduler.step(eval_score)
else:
elif self.scheduler is not None:
self.scheduler.step()

# log current learning rate in tensorboard
self._log_lr()
# remember best validation metric
Expand Down

0 comments on commit 85ae308

Please sign in to comment.