Skip to content

Commit cd2bd3c

Browse files
chualanagitAlan Chu
andauthored
Fix configure_optimizers example (#20420)
Co-authored-by: Alan Chu <[email protected]>
1 parent 20d19d2 commit cd2bd3c

File tree

1 file changed

+2
-1
lines changed
  • examples/fabric/build_your_own_trainer

1 file changed

+2
-1
lines changed

examples/fabric/build_your_own_trainer/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def training_step(self, batch, batch_idx: int):
4141

4242
def configure_optimizers(self):
4343
optim = torch.optim.Adam(self.parameters(), lr=1e-4)
44-
return optim, {
44+
return {
45+
"optimizer": optim,
4546
"scheduler": torch.optim.lr_scheduler.ReduceLROnPlateau(optim, mode="max", verbose=True),
4647
"monitor": "val_accuracy",
4748
"interval": "epoch",

0 commit comments

Comments
 (0)