Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with torch 1.12 where _scale_fn_ref is missing in CyclicLR #1575

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/super_gradients/training/utils/checkpoint_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1643,5 +1643,7 @@ def get_scheduler_state(scheduler) -> Dict[str, Tensor]:

state = scheduler.state_dict()
if isinstance(scheduler, CyclicLR) and not torch_version_is_greater_or_equal(2, 0):
del state["_scale_fn_ref"]
# A check is needed since torch 1.12 does not have the _scale_fn_ref attribute, while other versions do
if "_scale_fn_ref" in state:
del state["_scale_fn_ref"]
return state