Summary
TransferTrainer.setup_optimizers() constructs a torch.optim.lr_scheduler.ReduceLROnPlateau with an argument that newer torch versions no longer accept, raising a TypeError at scheduler construction. Three tests in tests/models/test_transfer_trainer.py fail as a result.
Failing tests
tests/models/test_transfer_trainer.py::TestTransferTrainer::test_setup_optimizers_with_transferred_layers
tests/models/test_transfer_trainer.py::TestTransferTrainer::test_transfer_learning_train_integration
tests/models/test_transfer_trainer.py::TestIntegrationWithSpatialNet::test_transfer_trainer_with_spatial_net
Cause
ReduceLROnPlateau in recent torch removed the verbose parameter (deprecated in 2.2, removed thereafter). Code written against an older torch passes it positionally or by keyword, which now raises TypeError.
Fix direction
Remove the unsupported argument from the ReduceLROnPlateau(...) call in src/models/transfer_trainer.py::setup_optimizers(). If verbose logging of LR changes is still wanted, log it explicitly rather than relying on the removed scheduler flag. Pin or document the supported torch version range in requirements.txt to prevent silent drift.
Summary
TransferTrainer.setup_optimizers()constructs atorch.optim.lr_scheduler.ReduceLROnPlateauwith an argument that newer torch versions no longer accept, raising aTypeErrorat scheduler construction. Three tests intests/models/test_transfer_trainer.pyfail as a result.Failing tests
Cause
ReduceLROnPlateauin recent torch removed theverboseparameter (deprecated in 2.2, removed thereafter). Code written against an older torch passes it positionally or by keyword, which now raisesTypeError.Fix direction
Remove the unsupported argument from the
ReduceLROnPlateau(...)call insrc/models/transfer_trainer.py::setup_optimizers(). If verbose logging of LR changes is still wanted, log it explicitly rather than relying on the removed scheduler flag. Pin or document the supported torch version range inrequirements.txtto prevent silent drift.