Skip to content

Commit

Permalink
Bump torch from 1.12.1 to 1.13.0 in /requirements (#875)
Browse files Browse the repository at this point in the history
* Bump torch from 1.12.1 to 1.13.0 in /requirements

Bumps [torch](https://github.com/pytorch/pytorch) from 1.12.1 to 1.13.0.
- [Release notes](https://github.com/pytorch/pytorch/releases)
- [Changelog](https://github.com/pytorch/pytorch/blob/master/RELEASE.md)
- [Commits](pytorch/pytorch@v1.12.1...v1.13.0)

---
updated-dependencies:
- dependency-name: torch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump torchvision from 1.13.1 to 1.14.0 in /requirements

* torch.load now has type hints

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
  • Loading branch information
dependabot[bot] and adamjstewart authored Oct 29, 2022
1 parent a07621a commit 00eff68
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions requirements/required.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ scikit-learn==1.1.3;python_version>='3.8'
segmentation-models-pytorch==0.3.0
shapely==1.8.5.post1
timm==0.4.12
torch==1.12.1
torch==1.13.0
torchmetrics==0.10.0
torchvision==0.13.1
torchvision==0.14.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ install_requires =
# torchmetrics 0.10+ required for binary/multiclass/multilabel classification metrics
torchmetrics>=0.10,<0.11
# torchvision 0.10+ required for torchvision.utils.draw_segmentation_masks
torchvision>=0.10,<0.14
torchvision>=0.10,<0.15
python_requires = ~= 3.7
packages = find:

Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def load_state_dict_from_file(
file_name: Optional[str] = None,
) -> Any:
"""Mockup of ``torch.hub.load_state_dict_from_url``."""
return torch.load(file) # type: ignore[no-untyped-call]
return torch.load(file)


@pytest.mark.parametrize(
Expand Down
4 changes: 1 addition & 3 deletions torchgeo/trainers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ def extract_encoder(path: str) -> Tuple[str, "OrderedDict[str, Tensor]"]:
ValueError: if 'classification_model' or 'encoder' not in
checkpoint['hyper_parameters']
"""
checkpoint = torch.load( # type: ignore[no-untyped-call]
path, map_location=torch.device("cpu")
)
checkpoint = torch.load(path, map_location=torch.device("cpu"))

if "classification_model" in checkpoint["hyper_parameters"]:
name = checkpoint["hyper_parameters"]["classification_model"]
Expand Down

0 comments on commit 00eff68

Please sign in to comment.