"docs/source/ko/sagemaker.mdx" did not exist on "da0e9ee69740b2c69be5aee9e062c9816613400d"
Unverified Commit f49a3453 authored by wasupandceacar's avatar wasupandceacar Committed by GitHub
Browse files

Fix `ReduceLROnPlateau` object has no attribute 'get_last_lr' (#23944)

* Fix 'ReduceLROnPlateau' object has no attribute 'get_last_lr'

* fix style
parent c62b01d0
......@@ -850,6 +850,9 @@ def _get_learning_rate(self):
last_lr = 0
else:
raise
else:
if isinstance(self.lr_scheduler, torch.optim.lr_scheduler.ReduceLROnPlateau):
last_lr = self.optimizer.param_groups[0]["lr"]
else:
last_lr = self.lr_scheduler.get_last_lr()[0]
if torch.is_tensor(last_lr):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment