From 8b7c19df931f4440d2af6a6764b4465c5a255b5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Feb 2023 20:31:25 +0000 Subject: [PATCH 1/5] Bump kornia from 0.6.9 to 0.6.10 in /requirements Bumps [kornia](https://github.com/kornia/kornia) from 0.6.9 to 0.6.10. - [Release notes](https://github.com/kornia/kornia/releases) - [Changelog](https://github.com/kornia/kornia/blob/master/CHANGELOG.md) - [Commits](https://github.com/kornia/kornia/compare/v0.6.9...v0.6.10) --- updated-dependencies: - dependency-name: kornia dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements/required.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/required.txt b/requirements/required.txt index 660adf05260..d5e0b24e0fd 100644 --- a/requirements/required.txt +++ b/requirements/required.txt @@ -4,7 +4,7 @@ setuptools==67.3.1 # install einops==0.6.0 fiona==1.9.1 -kornia==0.6.9 +kornia==0.6.10 matplotlib==3.7.0 numpy==1.24.2 omegaconf==2.3.0 From 92fd15e045d0b4937076ec15fde5ff9f0c0c5a7e Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 17 Feb 2023 17:36:28 -0600 Subject: [PATCH 2/5] Fix some warnings --- torchgeo/datamodules/landcoverai.py | 1 - torchgeo/datamodules/resisc45.py | 1 - torchgeo/datamodules/spacenet.py | 1 - torchgeo/trainers/byol.py | 4 +++- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/torchgeo/datamodules/landcoverai.py b/torchgeo/datamodules/landcoverai.py index 0ac1ec385ac..e77500e2c0e 100644 --- a/torchgeo/datamodules/landcoverai.py +++ b/torchgeo/datamodules/landcoverai.py @@ -43,7 +43,6 @@ def __init__( contrast=0.1, saturation=0.1, hue=0.1, - silence_instantiation_warning=True, ), data_keys=["image", "mask"], ) diff --git a/torchgeo/datamodules/resisc45.py b/torchgeo/datamodules/resisc45.py index cb1e9553553..4f332b48539 100644 --- a/torchgeo/datamodules/resisc45.py +++ b/torchgeo/datamodules/resisc45.py @@ -48,7 +48,6 @@ def __init__( contrast=0.1, saturation=0.1, hue=0.1, - silence_instantiation_warning=True, ), data_keys=["image"], ) diff --git a/torchgeo/datamodules/spacenet.py b/torchgeo/datamodules/spacenet.py index 802cc7a26c6..abdc4b18236 100644 --- a/torchgeo/datamodules/spacenet.py +++ b/torchgeo/datamodules/spacenet.py @@ -58,7 +58,6 @@ def __init__( contrast=0.1, saturation=0.1, hue=0.1, - silence_instantiation_warning=True, ), data_keys=["image", "mask"], ) diff --git a/torchgeo/trainers/byol.py b/torchgeo/trainers/byol.py index bc35eedf16d..14e5d950e3e 100644 --- a/torchgeo/trainers/byol.py +++ b/torchgeo/trainers/byol.py @@ -62,7 +62,9 @@ def __init__(self, image_size: Tuple[int, int] = (256, 256)) -> None: # K.ColorJitter(0.8, 0.8, 0.8, 0.8, 0.2), # K.RandomGrayscale(p=0.2), K.RandomHorizontalFlip(), - K.RandomGaussianBlur((3, 3), (1.5, 1.5), p=0.1), + K.RandomGaussianBlur( + (3, 3), (1.5, 1.5), p=0.1, silence_instantiation_warning=True + ), K.RandomResizedCrop(size=image_size), ) From b9f1b6a1006763056ca34427fe6b1aceb505a35a Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 17 Feb 2023 19:26:44 -0600 Subject: [PATCH 3/5] Add channel dimensions --- tests/transforms/test_indices.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/transforms/test_indices.py b/tests/transforms/test_indices.py index b3c0f8eb7e1..c58cf0887d5 100644 --- a/tests/transforms/test_indices.py +++ b/tests/transforms/test_indices.py @@ -30,7 +30,7 @@ def sample() -> Dict[str, Tensor]: return { "image": torch.arange(3 * 4 * 4, dtype=torch.float).view(3, 4, 4), - "mask": torch.arange(4 * 4, dtype=torch.long).view(4, 4), + "mask": torch.arange(4 * 4, dtype=torch.long).view(1, 4, 4), } @@ -38,7 +38,7 @@ def sample() -> Dict[str, Tensor]: def batch() -> Dict[str, Tensor]: return { "image": torch.arange(2 * 3 * 4 * 4, dtype=torch.float).view(2, 3, 4, 4), - "mask": torch.arange(2 * 4 * 4, dtype=torch.long).view(2, 4, 4), + "mask": torch.arange(2 * 4 * 4, dtype=torch.long).view(2, 1, 4, 4), } From b48d69123a5446542052352e63905918743f965a Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 18 Feb 2023 10:38:57 -0600 Subject: [PATCH 4/5] This arg will also disappear someday --- torchgeo/trainers/byol.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/torchgeo/trainers/byol.py b/torchgeo/trainers/byol.py index 14e5d950e3e..bc35eedf16d 100644 --- a/torchgeo/trainers/byol.py +++ b/torchgeo/trainers/byol.py @@ -62,9 +62,7 @@ def __init__(self, image_size: Tuple[int, int] = (256, 256)) -> None: # K.ColorJitter(0.8, 0.8, 0.8, 0.8, 0.2), # K.RandomGrayscale(p=0.2), K.RandomHorizontalFlip(), - K.RandomGaussianBlur( - (3, 3), (1.5, 1.5), p=0.1, silence_instantiation_warning=True - ), + K.RandomGaussianBlur((3, 3), (1.5, 1.5), p=0.1), K.RandomResizedCrop(size=image_size), ) From 55e2a1d38bc068c82710a8eb6061f001fb7d2fd1 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 18 Feb 2023 10:49:45 -0600 Subject: [PATCH 5/5] blacken, silence warnings --- pyproject.toml | 4 ++++ torchgeo/datamodules/landcoverai.py | 8 +------- torchgeo/datamodules/resisc45.py | 8 +------- torchgeo/datamodules/spacenet.py | 8 +------- 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ad096b8d987..0762fd6dfaf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,6 +102,10 @@ filterwarnings = [ "ignore:The dataloader, .*, does not have many workers which may be a bottleneck:UserWarning", # pytorch-lightning warns us about using the CPU when a GPU is available "ignore:GPU available but not used.:UserWarning", + # https://github.com/kornia/kornia/pull/1611 + "ignore:`ColorJitter` is now following Torchvision implementation.:DeprecationWarning:kornia.augmentation._2d.intensity.color_jitter", + # https://github.com/kornia/kornia/pull/1663 + "ignore:`RandomGaussianBlur` has changed its behavior and now randomly sample sigma for both axes.:DeprecationWarning:kornia.augmentation._2d.intensity.gaussian_blur", # Unexpected warnings, worth investigating # pytorch-lightning is having trouble inferring the batch size for ChesapeakeCVPRDataModule and CycloneDataModule for some reason diff --git a/torchgeo/datamodules/landcoverai.py b/torchgeo/datamodules/landcoverai.py index e77500e2c0e..c6994f99d54 100644 --- a/torchgeo/datamodules/landcoverai.py +++ b/torchgeo/datamodules/landcoverai.py @@ -37,13 +37,7 @@ def __init__( K.RandomHorizontalFlip(p=0.5), K.RandomVerticalFlip(p=0.5), K.RandomSharpness(p=0.5), - K.ColorJitter( - p=0.5, - brightness=0.1, - contrast=0.1, - saturation=0.1, - hue=0.1, - ), + K.ColorJitter(p=0.5, brightness=0.1, contrast=0.1, saturation=0.1, hue=0.1), data_keys=["image", "mask"], ) self.aug = AugmentationSequential( diff --git a/torchgeo/datamodules/resisc45.py b/torchgeo/datamodules/resisc45.py index 4f332b48539..564ca07b739 100644 --- a/torchgeo/datamodules/resisc45.py +++ b/torchgeo/datamodules/resisc45.py @@ -42,12 +42,6 @@ def __init__( K.RandomVerticalFlip(p=0.5), K.RandomSharpness(p=0.5), K.RandomErasing(p=0.1), - K.ColorJitter( - p=0.5, - brightness=0.1, - contrast=0.1, - saturation=0.1, - hue=0.1, - ), + K.ColorJitter(p=0.5, brightness=0.1, contrast=0.1, saturation=0.1, hue=0.1), data_keys=["image"], ) diff --git a/torchgeo/datamodules/spacenet.py b/torchgeo/datamodules/spacenet.py index abdc4b18236..90a6f6f5ac6 100644 --- a/torchgeo/datamodules/spacenet.py +++ b/torchgeo/datamodules/spacenet.py @@ -52,13 +52,7 @@ def __init__( K.RandomHorizontalFlip(p=0.5), K.RandomVerticalFlip(p=0.5), K.RandomSharpness(p=0.5), - K.ColorJitter( - p=0.5, - brightness=0.1, - contrast=0.1, - saturation=0.1, - hue=0.1, - ), + K.ColorJitter(p=0.5, brightness=0.1, contrast=0.1, saturation=0.1, hue=0.1), data_keys=["image", "mask"], ) self.aug = AugmentationSequential(