From fb514a51bd6376013a4969fabf2d196cf9594d80 Mon Sep 17 00:00:00 2001 From: Caleb Robinson Date: Sat, 17 Dec 2022 10:18:28 -0800 Subject: [PATCH] Fix landcoverai datamodule (#959) --- conf/landcoverai.yaml | 2 +- torchgeo/datamodules/landcoverai.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/landcoverai.yaml b/conf/landcoverai.yaml index 986484080..d01e3120f 100644 --- a/conf/landcoverai.yaml +++ b/conf/landcoverai.yaml @@ -13,7 +13,7 @@ experiment: learning_rate: 1e-3 learning_rate_schedule_patience: 6 in_channels: 3 - num_classes: 6 + num_classes: 5 num_filters: 256 ignore_index: null datamodule: diff --git a/torchgeo/datamodules/landcoverai.py b/torchgeo/datamodules/landcoverai.py index b4df99446..463b0e3c8 100644 --- a/torchgeo/datamodules/landcoverai.py +++ b/torchgeo/datamodules/landcoverai.py @@ -97,7 +97,7 @@ class LandCoverAIDataModule(pl.LightningDataModule): sample["image"] /= 255.0 if "mask" in sample: - sample["mask"] = sample["mask"].long() + 1 + sample["mask"] = sample["mask"].long() return sample