diff --git a/docs/conf.py b/docs/conf.py index 4078970c2e4..df1de398185 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,6 +59,8 @@ ('py:class', 'fiona.model.Feature'), ('py:class', 'kornia.augmentation._2d.intensity.base.IntensityAugmentationBase2D'), ('py:class', 'kornia.augmentation.base._AugmentationBase'), + ('py:class', 'lightning.pytorch.utilities.types.LRSchedulerConfig'), + ('py:class', 'lightning.pytorch.utilities.types.OptimizerConfig'), ('py:class', 'lightning.pytorch.utilities.types.OptimizerLRSchedulerConfig'), ('py:class', 'segmentation_models_pytorch.base.model.SegmentationModel'), ('py:class', 'timm.models.resnet.ResNet'), diff --git a/pyproject.toml b/pyproject.toml index a37a7bd759e..a4e125f5a31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ dependencies = [ # lightning 2+ required for LightningCLI args + sys.argv support # lightning 2.3 contains known bugs related to YAML parsing # https://github.com/Lightning-AI/pytorch-lightning/issues/19977 - "lightning[pytorch-extra]>=2,!=2.3.*", + "lightning[pytorch-extra]>=2,!=2.3.*,!=2.5.0", # matplotlib 3.5+ required for Python 3.10 wheels "matplotlib>=3.5", # numpy 1.21.2+ required by Python 3.10 wheels diff --git a/requirements/required.txt b/requirements/required.txt index d40386f4246..815960b0661 100644 --- a/requirements/required.txt +++ b/requirements/required.txt @@ -6,7 +6,7 @@ einops==0.8.0 fiona==1.10.1 kornia==0.7.4 lightly==1.5.15 -lightning[pytorch-extra]==2.4.0 +lightning[pytorch-extra]==2.5.0.post0 matplotlib==3.10.0 numpy==2.2.1 pandas==2.2.3 diff --git a/torchgeo/trainers/base.py b/torchgeo/trainers/base.py index 35666e98e4c..02628ba08cb 100644 --- a/torchgeo/trainers/base.py +++ b/torchgeo/trainers/base.py @@ -55,7 +55,7 @@ def configure_metrics(self) -> None: def configure_optimizers( self, - ) -> 'lightning.pytorch.utilities.types.OptimizerLRSchedulerConfig': + ) -> 'lightning.pytorch.utilities.types.OptimizerLRScheduler': """Initialize the optimizer and learning rate scheduler. Returns: diff --git a/torchgeo/trainers/iobench.py b/torchgeo/trainers/iobench.py index c8826a1dce5..c7be263dac9 100644 --- a/torchgeo/trainers/iobench.py +++ b/torchgeo/trainers/iobench.py @@ -24,7 +24,7 @@ def configure_models(self) -> None: def configure_optimizers( self, - ) -> 'lightning.pytorch.utilities.types.OptimizerLRSchedulerConfig': + ) -> 'lightning.pytorch.utilities.types.OptimizerLRScheduler': """Initialize the optimizer. Returns: diff --git a/torchgeo/trainers/moco.py b/torchgeo/trainers/moco.py index b079543adba..ce35855c12f 100644 --- a/torchgeo/trainers/moco.py +++ b/torchgeo/trainers/moco.py @@ -293,7 +293,7 @@ def configure_losses(self) -> None: def configure_optimizers( self, - ) -> 'lightning.pytorch.utilities.types.OptimizerLRSchedulerConfig': + ) -> 'lightning.pytorch.utilities.types.OptimizerLRScheduler': """Initialize the optimizer and learning rate scheduler. Returns: diff --git a/torchgeo/trainers/simclr.py b/torchgeo/trainers/simclr.py index 1cb05315f60..a0625f26ebb 100644 --- a/torchgeo/trainers/simclr.py +++ b/torchgeo/trainers/simclr.py @@ -286,7 +286,7 @@ def predict_step(self, batch: Any, batch_idx: int, dataloader_idx: int = 0) -> N def configure_optimizers( self, - ) -> 'lightning.pytorch.utilities.types.OptimizerLRSchedulerConfig': + ) -> 'lightning.pytorch.utilities.types.OptimizerLRScheduler': """Initialize the optimizer and learning rate scheduler. .. versionchanged:: 0.6