Skip to content

Commit fced238

Browse files
Alan ChuAlan Chu
authored andcommitted
Fix configure_optimizers example
1 parent 3627c5b commit fced238

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)