From 3559517a11db5e7c4fae2c0660f9e7ba86348bab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:28:25 +0000 Subject: [PATCH] Bump the torch group in /requirements with 2 updates (#2353) * Bump the torch group in /requirements with 2 updates Bumps the torch group in /requirements with 2 updates: [torch](https://github.com/pytorch/pytorch) and [torchvision](https://github.com/pytorch/vision). Updates `torch` from 2.4.1 to 2.5.0 - [Release notes](https://github.com/pytorch/pytorch/releases) - [Changelog](https://github.com/pytorch/pytorch/blob/main/RELEASE.md) - [Commits](https://github.com/pytorch/pytorch/compare/v2.4.1...v2.5.0) Updates `torchvision` from 0.19.1 to 0.20.0 - [Release notes](https://github.com/pytorch/vision/releases) - [Commits](https://github.com/pytorch/vision/compare/v0.19.1...v0.20.0) --- updated-dependencies: - dependency-name: torch dependency-type: direct:production update-type: version-update:semver-minor dependency-group: torch - dependency-name: torchvision dependency-type: direct:production update-type: version-update:semver-minor dependency-group: torch ... Signed-off-by: dependabot[bot] * Remove unused ignores --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adam J. Stewart --- experiments/torchgeo/benchmark.py | 2 +- requirements/required.txt | 4 ++-- torchgeo/trainers/base.py | 2 +- torchgeo/trainers/iobench.py | 2 +- torchgeo/trainers/moco.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/experiments/torchgeo/benchmark.py b/experiments/torchgeo/benchmark.py index 2db320d6af0..f5d0fd8eba6 100755 --- a/experiments/torchgeo/benchmark.py +++ b/experiments/torchgeo/benchmark.py @@ -217,7 +217,7 @@ def main(args: argparse.Namespace) -> None: criterion = nn.CrossEntropyLoss() params = model.parameters() - optimizer = optim.SGD(params, lr=0.0001) # type: ignore[attr-defined] + optimizer = optim.SGD(params, lr=0.0001) device = torch.device('cuda' if torch.cuda.is_available() else 'cpu', args.device) model = model.to(device) diff --git a/requirements/required.txt b/requirements/required.txt index 0d05f3c6882..c253170fbdb 100644 --- a/requirements/required.txt +++ b/requirements/required.txt @@ -17,6 +17,6 @@ rtree==1.3.0 segmentation-models-pytorch==0.3.4 shapely==2.0.6 timm==0.9.7 -torch==2.4.1 +torch==2.5.0 torchmetrics==1.4.3 -torchvision==0.19.1 +torchvision==0.20.0 diff --git a/torchgeo/trainers/base.py b/torchgeo/trainers/base.py index 0bee76aeed1..35666e98e4c 100644 --- a/torchgeo/trainers/base.py +++ b/torchgeo/trainers/base.py @@ -9,7 +9,7 @@ import lightning from lightning.pytorch import LightningModule -from torch.optim import AdamW # type: ignore[attr-defined] +from torch.optim import AdamW from torch.optim.lr_scheduler import ReduceLROnPlateau diff --git a/torchgeo/trainers/iobench.py b/torchgeo/trainers/iobench.py index 6ab5c7f9bc6..c8826a1dce5 100644 --- a/torchgeo/trainers/iobench.py +++ b/torchgeo/trainers/iobench.py @@ -8,7 +8,7 @@ import lightning import torch from torch import Tensor -from torch.optim import SGD # type: ignore[attr-defined] +from torch.optim import SGD from .base import BaseTask diff --git a/torchgeo/trainers/moco.py b/torchgeo/trainers/moco.py index d41f2ea581c..b079543adba 100644 --- a/torchgeo/trainers/moco.py +++ b/torchgeo/trainers/moco.py @@ -19,7 +19,7 @@ from lightly.models.utils import deactivate_requires_grad, update_momentum from lightly.utils.scheduler import cosine_schedule from torch import Tensor -from torch.optim import SGD, AdamW, Optimizer # type: ignore[attr-defined] +from torch.optim import SGD, AdamW, Optimizer from torch.optim.lr_scheduler import ( CosineAnnealingLR, LinearLR,