From cd2bd3ce532c30e963fce0f20eb2f42a4e343b64 Mon Sep 17 00:00:00 2001 From: Alan Chu <30797645+chualanagit@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:41:44 -0800 Subject: [PATCH] Fix configure_optimizers example (#20420) Co-authored-by: Alan Chu --- examples/fabric/build_your_own_trainer/run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/fabric/build_your_own_trainer/run.py b/examples/fabric/build_your_own_trainer/run.py index 01044f5d94..c0c2ff28dd 100644 --- a/examples/fabric/build_your_own_trainer/run.py +++ b/examples/fabric/build_your_own_trainer/run.py @@ -41,7 +41,8 @@ class MNISTModule(L.LightningModule): def configure_optimizers(self): optim = torch.optim.Adam(self.parameters(), lr=1e-4) - return optim, { + return { + "optimizer": optim, "scheduler": torch.optim.lr_scheduler.ReduceLROnPlateau(optim, mode="max", verbose=True), "monitor": "val_accuracy", "interval": "epoch",