fix(training): drop removed ReduceLROnPlateau verbose arg (#22)#34
Open
bradsmithmba wants to merge 1 commit into
Open
fix(training): drop removed ReduceLROnPlateau verbose arg (#22)#34bradsmithmba wants to merge 1 commit into
bradsmithmba wants to merge 1 commit into
Conversation
ReduceLROnPlateau was constructed with verbose=True in both TransferTrainer.setup_optimizers() and Trainer.__init__. PyTorch deprecated the scheduler verbose parameter in 2.2 and removed it thereafter, so on current torch (2.12 here) the constructor raises TypeError and any code path that builds the scheduler dies. This broke 3 tests in tests/models/test_transfer_trainer.py at optimizer setup. Remove the unsupported verbose argument from both call sites. No behavior change beyond losing the scheduler's built-in LR-change logging, which the removed flag no longer provides anyway. Closes cloudtrainerwork#22 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ReduceLROnPlateauwas constructed withverbose=Truein two places:src/models/transfer_trainer.py—TransferTrainer.setup_optimizers()src/training/trainer.py—Trainer.__init__PyTorch deprecated the scheduler
verboseparameter in 2.2 and removed it afterward. On current torch the constructor raisesTypeError: ReduceLROnPlateau.__init__() got an unexpected keyword argument 'verbose', so any path that builds the scheduler fails. This broke 3 tests intests/models/test_transfer_trainer.pyat optimizer setup.Closes #22.
Fix
Remove
verbose=Truefrom both call sites. Both sites were found (the issue mentionedtransfer_trainer;trainer.pyhas the identical defect and is fixed here too).Verification
On torch 2.12.0:
CI note
tests/models/test_transfer_trainer.pytransitively imports thesrc.featureschain, which is broken until #1 (PR #19) merges, so the file can't be collected onmasteryet. The corrected scheduler construction was verified directly against torch 2.12. The 3 tests run once #1 lands.🤖 Generated with Claude Code