From 5136d819c0c19a565ad5228885e46d3bf8f3fd99 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 8 Jan 2022 10:11:49 -0600 Subject: [PATCH] Reorganize configuration files (#352) * Reorganize configuration files * Undo changes to tests/conf files --- conf/bigearthnet.yaml | 12 ++++--- conf/byol.yaml | 8 +++-- conf/chesapeake_cvpr.yaml | 20 +++++++---- conf/cowc_counting.yaml | 14 ++++---- conf/cyclone.yaml | 16 ++++----- conf/etci2021.yaml | 16 +++++++++ conf/eurosat.yaml | 14 ++++++++ conf/landcoverai.yaml | 12 +++---- conf/naipchesapeake.yaml | 34 +++++++++++++------ conf/oscd.yaml | 11 +++--- conf/resisc45.yaml | 8 +++-- conf/sen12ms.yaml | 29 +++++++++++----- conf/so2sat.yaml | 9 +++-- conf/ucmerced.yaml | 14 ++++++++ .../conf}/bigearthnet_all.yaml | 0 .../conf}/bigearthnet_s1.yaml | 0 .../conf}/bigearthnet_s2.yaml | 0 {conf/task_defaults => tests/conf}/byol.yaml | 0 .../conf}/chesapeake_cvpr_5.yaml | 0 .../conf}/chesapeake_cvpr_7.yaml | 0 .../conf}/chesapeake_cvpr_prior.yaml | 0 .../conf}/cowc_counting.yaml | 0 .../task_defaults => tests/conf}/cyclone.yaml | 0 .../conf}/etci2021.yaml | 0 .../task_defaults => tests/conf}/eurosat.yaml | 0 .../conf}/landcoverai.yaml | 0 .../conf}/naipchesapeake.yaml | 0 .../conf}/oscd_all.yaml | 0 .../conf}/oscd_rgb.yaml | 0 .../conf}/resisc45.yaml | 0 .../conf}/sen12ms_all.yaml | 0 .../conf}/sen12ms_s1.yaml | 0 .../conf}/sen12ms_s2_all.yaml | 0 .../conf}/sen12ms_s2_reduced.yaml | 0 .../conf}/so2sat_supervised.yaml | 0 .../conf}/so2sat_unsupervised.yaml | 0 .../conf}/ucmerced.yaml | 0 tests/datamodules/test_chesapeake.py | 4 +-- tests/trainers/test_byol.py | 2 +- tests/trainers/test_classification.py | 10 +++--- tests/trainers/test_regression.py | 4 +-- tests/trainers/test_segmentation.py | 4 +-- train.py | 21 ++++-------- 43 files changed, 166 insertions(+), 96 deletions(-) create mode 100644 conf/etci2021.yaml create mode 100644 conf/eurosat.yaml create mode 100644 conf/ucmerced.yaml rename {conf/task_defaults => tests/conf}/bigearthnet_all.yaml (100%) rename {conf/task_defaults => tests/conf}/bigearthnet_s1.yaml (100%) rename {conf/task_defaults => tests/conf}/bigearthnet_s2.yaml (100%) rename {conf/task_defaults => tests/conf}/byol.yaml (100%) rename {conf/task_defaults => tests/conf}/chesapeake_cvpr_5.yaml (100%) rename {conf/task_defaults => tests/conf}/chesapeake_cvpr_7.yaml (100%) rename {conf/task_defaults => tests/conf}/chesapeake_cvpr_prior.yaml (100%) rename {conf/task_defaults => tests/conf}/cowc_counting.yaml (100%) rename {conf/task_defaults => tests/conf}/cyclone.yaml (100%) rename {conf/task_defaults => tests/conf}/etci2021.yaml (100%) rename {conf/task_defaults => tests/conf}/eurosat.yaml (100%) rename {conf/task_defaults => tests/conf}/landcoverai.yaml (100%) rename {conf/task_defaults => tests/conf}/naipchesapeake.yaml (100%) rename {conf/task_defaults => tests/conf}/oscd_all.yaml (100%) rename {conf/task_defaults => tests/conf}/oscd_rgb.yaml (100%) rename {conf/task_defaults => tests/conf}/resisc45.yaml (100%) rename {conf/task_defaults => tests/conf}/sen12ms_all.yaml (100%) rename {conf/task_defaults => tests/conf}/sen12ms_s1.yaml (100%) rename {conf/task_defaults => tests/conf}/sen12ms_s2_all.yaml (100%) rename {conf/task_defaults => tests/conf}/sen12ms_s2_reduced.yaml (100%) rename {conf/task_defaults => tests/conf}/so2sat_supervised.yaml (100%) rename {conf/task_defaults => tests/conf}/so2sat_unsupervised.yaml (100%) rename {conf/task_defaults => tests/conf}/ucmerced.yaml (100%) diff --git a/conf/bigearthnet.yaml b/conf/bigearthnet.yaml index a6682f888be..abfd0dbcb63 100644 --- a/conf/bigearthnet.yaml +++ b/conf/bigearthnet.yaml @@ -1,9 +1,8 @@ trainer: - gpus: 1 # single GPU training + gpus: 1 min_epochs: 10 max_epochs: 40 benchmark: True - experiment: task: "bigearthnet" module: @@ -11,9 +10,12 @@ experiment: classification_model: "resnet18" learning_rate: 1e-3 learning_rate_schedule_patience: 6 + weights: "random" in_channels: 14 - datamodule: num_classes: 19 - batch_size: 128 - num_workers: 6 + datamodule: + root_dir: "data/bigearthnet" bands: "all" + num_classes: ${experiment.module.num_classes} + batch_size: 128 + num_workers: 4 diff --git a/conf/byol.yaml b/conf/byol.yaml index b13cd11ca88..c62515c747d 100644 --- a/conf/byol.yaml +++ b/conf/byol.yaml @@ -3,7 +3,6 @@ trainer: min_epochs: 20 max_epochs: 100 benchmark: True - experiment: task: "ssl" name: "test_byol" @@ -12,12 +11,15 @@ experiment: encoder: "resnet18" input_channels: 4 imagenet_pretraining: True + learning_rate: 1e-3 + learning_rate_schedule_patience: 6 datamodule: - batch_size: 64 - num_workers: 6 + root_dir: "data/chesapeake/cvpr" train_splits: - "de-train" val_splits: - "de-val" test_splits: - "de-test" + batch_size: 64 + num_workers: 4 diff --git a/conf/chesapeake_cvpr.yaml b/conf/chesapeake_cvpr.yaml index 8ccb74ad643..f37f1e7fe0c 100644 --- a/conf/chesapeake_cvpr.yaml +++ b/conf/chesapeake_cvpr.yaml @@ -1,29 +1,35 @@ trainer: - gpus: 1 # single GPU training + gpus: 1 min_epochs: 20 max_epochs: 100 benchmark: True - experiment: task: "chesapeake_cvpr" name: "chesapeake_cvpr_example" module: - loss: "ce" # cross entropy loss + loss: "ce" segmentation_model: "unet" encoder_name: "resnet18" - encoder_weights: null # use ImageNet weight initialization + encoder_weights: null encoder_output_stride: 16 - learning_rate: 1e-2 + learning_rate: 1e-3 learning_rate_schedule_patience: 6 in_channels: 4 num_classes: 7 num_filters: 256 + ignore_zeros: False + imagenet_pretraining: True datamodule: - batch_size: 64 - num_workers: 6 + root_dir: "data/chesapeake/cvpr" train_splits: - "de-train" val_splits: - "de-val" test_splits: - "de-test" + patches_per_tile: 200 + patch_size: 256 + batch_size: 64 + num_workers: 4 + class_set: ${experiment.module.num_classes} + use_prior_labels: False diff --git a/conf/cowc_counting.yaml b/conf/cowc_counting.yaml index 2419437cf86..69ebd4a1ae4 100644 --- a/conf/cowc_counting.yaml +++ b/conf/cowc_counting.yaml @@ -1,7 +1,6 @@ -program: # These are the arguments that define how the train.py script works - seed: 1337 - overwrite: True - +trainer: + gpus: 1 + min_epochs: 15 experiment: task: cowc_counting name: cowc_counting_test @@ -9,10 +8,9 @@ experiment: model: resnet18 learning_rate: 1e-3 learning_rate_schedule_patience: 2 + pretrained: True datamodule: + root_dir: "data/cowc_counting" + seed: 0 batch_size: 32 num_workers: 4 - -trainer: - min_epochs: 15 - gpus: 1 diff --git a/conf/cyclone.yaml b/conf/cyclone.yaml index ae659ec0af4..5aeed1c0907 100644 --- a/conf/cyclone.yaml +++ b/conf/cyclone.yaml @@ -1,18 +1,16 @@ -program: # These are the arguments that define how the train.py script works - seed: 1337 - overwrite: True - +trainer: + gpus: 1 + min_epochs: 15 experiment: task: "cyclone" - name: cyclone_test + name: "cyclone_test" module: model: "resnet18" learning_rate: 1e-3 learning_rate_schedule_patience: 2 + pretrained: True datamodule: + root_dir: "data/cyclone" + seed: 0 batch_size: 32 num_workers: 4 - -trainer: - min_epochs: 15 - gpus: 1 diff --git a/conf/etci2021.yaml b/conf/etci2021.yaml new file mode 100644 index 00000000000..a93303ac1a8 --- /dev/null +++ b/conf/etci2021.yaml @@ -0,0 +1,16 @@ +experiment: + task: "etci2021" + module: + loss: "ce" + segmentation_model: "unet" + encoder_name: "resnet18" + encoder_weights: "imagenet" + learning_rate: 1e-3 + learning_rate_schedule_patience: 6 + in_channels: 7 + num_classes: 2 + ignore_zeros: True + datamodule: + root_dir: "data/etci2021" + batch_size: 32 + num_workers: 4 diff --git a/conf/eurosat.yaml b/conf/eurosat.yaml new file mode 100644 index 00000000000..f726154fc36 --- /dev/null +++ b/conf/eurosat.yaml @@ -0,0 +1,14 @@ +experiment: + task: "eurosat" + module: + loss: "ce" + classification_model: "resnet18" + learning_rate: 1e-3 + learning_rate_schedule_patience: 6 + weights: "random" + in_channels: 13 + num_classes: 10 + datamodule: + root_dir: "data/eurosat" + batch_size: 128 + num_workers: 4 diff --git a/conf/landcoverai.yaml b/conf/landcoverai.yaml index ae526557455..9d7183dcf78 100644 --- a/conf/landcoverai.yaml +++ b/conf/landcoverai.yaml @@ -1,22 +1,22 @@ trainer: - gpus: 1 # single GPU training + gpus: 1 min_epochs: 20 max_epochs: 100 benchmark: True - experiment: task: "landcoverai" module: loss: "ce" - segmentation_model: "deeplabv3+" + segmentation_model: "unet" encoder_name: "resnet18" - encoder_weights: null - encoder_output_stride: 16 + encoder_weights: "imagenet" learning_rate: 1e-3 learning_rate_schedule_patience: 6 in_channels: 3 num_classes: 6 num_filters: 256 + ignore_zeros: False datamodule: + root_dir: "data/landcoverai" batch_size: 32 - num_workers: 6 + num_workers: 4 diff --git a/conf/naipchesapeake.yaml b/conf/naipchesapeake.yaml index 53a1c306a4f..79541b83ae4 100644 --- a/conf/naipchesapeake.yaml +++ b/conf/naipchesapeake.yaml @@ -1,13 +1,25 @@ -program: # These are experiment level arguments - experiment_name: naip_chesapeake_test +program: + experiment_name: "naip_chesapeake_test" overwrite: True - naip_data_dir: data/naip - chesapeake_data_dir: data/chesapeake - -trainer: # These are all the arguments that will be passed to the pl.Trainer +trainer: min_epochs: 15 - -task: # These are all the arguments that will be used to create an appropriate task - name: naipchesapeake - learning_rate: 1e-3 - learning_rate_schedule_patience: 2 +experiment: + task: "naipchesapeake" + module: + loss: "ce" + segmentation_model: "deeplabv3+" + encoder_name: "resnet34" + encoder_weights: "imagenet" + encoder_output_stride: 16 + learning_rate: 1e-3 + learning_rate_schedule_patience: 2 + in_channels: 4 + num_classes: 13 + num_filters: 64 + ignore_zeros: False + datamodule: + naip_root_dir: "data/naip" + chesapeake_root_dir: "data/chesapeake/BAYWIDE" + batch_size: 32 + num_workers: 4 + patch_size: 32 diff --git a/conf/oscd.yaml b/conf/oscd.yaml index d7d1822254f..0959cd01595 100644 --- a/conf/oscd.yaml +++ b/conf/oscd.yaml @@ -3,7 +3,6 @@ trainer: min_epochs: 20 max_epochs: 500 benchmark: True - experiment: task: "oscd" module: @@ -16,11 +15,15 @@ experiment: verbose: false in_channels: 26 num_classes: 2 - num_filters: 128 + num_filters: 256 ignore_zeros: True datamodule: - train_batch_size: 2 - num_workers: 6 + root_dir: "data/oscd" + batch_size: 32 + num_workers: 4 val_split_pct: 0.1 bands: "all" + pad_size: + - 1028 + - 1028 num_patches_per_tile: 128 diff --git a/conf/resisc45.yaml b/conf/resisc45.yaml index 3650b39b56c..109775cd8ae 100644 --- a/conf/resisc45.yaml +++ b/conf/resisc45.yaml @@ -1,9 +1,8 @@ trainer: - gpus: 1 # single GPU training + gpus: 1 min_epochs: 10 max_epochs: 40 benchmark: True - experiment: task: "resisc45" module: @@ -12,6 +11,9 @@ experiment: learning_rate: 1e-3 learning_rate_schedule_patience: 6 weights: "random" + in_channels: 3 + num_classes: 45 datamodule: + root_dir: "data/resisc45" batch_size: 128 - num_workers: 6 + num_workers: 4 diff --git a/conf/sen12ms.yaml b/conf/sen12ms.yaml index c7df526736a..e413537b58b 100644 --- a/conf/sen12ms.yaml +++ b/conf/sen12ms.yaml @@ -1,11 +1,24 @@ -program: # These are experiment level arguments +program: experiment_name: sen12ms_test overwrite: True - -trainer: # These are all the arguments that will be passed to the pl.Trainer +trainer: min_epochs: 15 - -task: # These are all the arguments that will be used to create an appropriate task - name: sen12ms - learning_rate: 1e-3 - learning_rate_schedule_patience: 2 +experiment: + task: "sen12ms" + module: + loss: "ce" + segmentation_model: "unet" + encoder_name: "resnet18" + encoder_weights: null + encoder_output_stride: 16 + learning_rate: 1e-3 + learning_rate_schedule_patience: 2 + in_channels: 15 + num_classes: 11 + ignore_zeros: False + datamodule: + root_dir: "data/sen12ms" + band_set: "all" + batch_size: 32 + num_workers: 4 + seed: 0 diff --git a/conf/so2sat.yaml b/conf/so2sat.yaml index f320aa8f471..980d7f3fbbd 100644 --- a/conf/so2sat.yaml +++ b/conf/so2sat.yaml @@ -1,9 +1,8 @@ trainer: - gpus: 1 # single GPU training + gpus: 1 min_epochs: 10 max_epochs: 40 benchmark: True - experiment: task: "so2sat" module: @@ -11,8 +10,12 @@ experiment: classification_model: "resnet18" learning_rate: 1e-3 learning_rate_schedule_patience: 6 + weights: "random" in_channels: 3 + num_classes: 17 datamodule: + root_dir: "data/so2sat" batch_size: 128 - num_workers: 6 + num_workers: 4 bands: "rgb" + unsupervised_mode: False diff --git a/conf/ucmerced.yaml b/conf/ucmerced.yaml new file mode 100644 index 00000000000..28b526d3219 --- /dev/null +++ b/conf/ucmerced.yaml @@ -0,0 +1,14 @@ +experiment: + task: "ucmerced" + module: + loss: "ce" + classification_model: "resnet18" + weights: null + learning_rate: 1e-3 + learning_rate_schedule_patience: 6 + in_channels: 3 + num_classes: 21 + datamodule: + root_dir: "data/ucmerced" + batch_size: 128 + num_workers: 4 diff --git a/conf/task_defaults/bigearthnet_all.yaml b/tests/conf/bigearthnet_all.yaml similarity index 100% rename from conf/task_defaults/bigearthnet_all.yaml rename to tests/conf/bigearthnet_all.yaml diff --git a/conf/task_defaults/bigearthnet_s1.yaml b/tests/conf/bigearthnet_s1.yaml similarity index 100% rename from conf/task_defaults/bigearthnet_s1.yaml rename to tests/conf/bigearthnet_s1.yaml diff --git a/conf/task_defaults/bigearthnet_s2.yaml b/tests/conf/bigearthnet_s2.yaml similarity index 100% rename from conf/task_defaults/bigearthnet_s2.yaml rename to tests/conf/bigearthnet_s2.yaml diff --git a/conf/task_defaults/byol.yaml b/tests/conf/byol.yaml similarity index 100% rename from conf/task_defaults/byol.yaml rename to tests/conf/byol.yaml diff --git a/conf/task_defaults/chesapeake_cvpr_5.yaml b/tests/conf/chesapeake_cvpr_5.yaml similarity index 100% rename from conf/task_defaults/chesapeake_cvpr_5.yaml rename to tests/conf/chesapeake_cvpr_5.yaml diff --git a/conf/task_defaults/chesapeake_cvpr_7.yaml b/tests/conf/chesapeake_cvpr_7.yaml similarity index 100% rename from conf/task_defaults/chesapeake_cvpr_7.yaml rename to tests/conf/chesapeake_cvpr_7.yaml diff --git a/conf/task_defaults/chesapeake_cvpr_prior.yaml b/tests/conf/chesapeake_cvpr_prior.yaml similarity index 100% rename from conf/task_defaults/chesapeake_cvpr_prior.yaml rename to tests/conf/chesapeake_cvpr_prior.yaml diff --git a/conf/task_defaults/cowc_counting.yaml b/tests/conf/cowc_counting.yaml similarity index 100% rename from conf/task_defaults/cowc_counting.yaml rename to tests/conf/cowc_counting.yaml diff --git a/conf/task_defaults/cyclone.yaml b/tests/conf/cyclone.yaml similarity index 100% rename from conf/task_defaults/cyclone.yaml rename to tests/conf/cyclone.yaml diff --git a/conf/task_defaults/etci2021.yaml b/tests/conf/etci2021.yaml similarity index 100% rename from conf/task_defaults/etci2021.yaml rename to tests/conf/etci2021.yaml diff --git a/conf/task_defaults/eurosat.yaml b/tests/conf/eurosat.yaml similarity index 100% rename from conf/task_defaults/eurosat.yaml rename to tests/conf/eurosat.yaml diff --git a/conf/task_defaults/landcoverai.yaml b/tests/conf/landcoverai.yaml similarity index 100% rename from conf/task_defaults/landcoverai.yaml rename to tests/conf/landcoverai.yaml diff --git a/conf/task_defaults/naipchesapeake.yaml b/tests/conf/naipchesapeake.yaml similarity index 100% rename from conf/task_defaults/naipchesapeake.yaml rename to tests/conf/naipchesapeake.yaml diff --git a/conf/task_defaults/oscd_all.yaml b/tests/conf/oscd_all.yaml similarity index 100% rename from conf/task_defaults/oscd_all.yaml rename to tests/conf/oscd_all.yaml diff --git a/conf/task_defaults/oscd_rgb.yaml b/tests/conf/oscd_rgb.yaml similarity index 100% rename from conf/task_defaults/oscd_rgb.yaml rename to tests/conf/oscd_rgb.yaml diff --git a/conf/task_defaults/resisc45.yaml b/tests/conf/resisc45.yaml similarity index 100% rename from conf/task_defaults/resisc45.yaml rename to tests/conf/resisc45.yaml diff --git a/conf/task_defaults/sen12ms_all.yaml b/tests/conf/sen12ms_all.yaml similarity index 100% rename from conf/task_defaults/sen12ms_all.yaml rename to tests/conf/sen12ms_all.yaml diff --git a/conf/task_defaults/sen12ms_s1.yaml b/tests/conf/sen12ms_s1.yaml similarity index 100% rename from conf/task_defaults/sen12ms_s1.yaml rename to tests/conf/sen12ms_s1.yaml diff --git a/conf/task_defaults/sen12ms_s2_all.yaml b/tests/conf/sen12ms_s2_all.yaml similarity index 100% rename from conf/task_defaults/sen12ms_s2_all.yaml rename to tests/conf/sen12ms_s2_all.yaml diff --git a/conf/task_defaults/sen12ms_s2_reduced.yaml b/tests/conf/sen12ms_s2_reduced.yaml similarity index 100% rename from conf/task_defaults/sen12ms_s2_reduced.yaml rename to tests/conf/sen12ms_s2_reduced.yaml diff --git a/conf/task_defaults/so2sat_supervised.yaml b/tests/conf/so2sat_supervised.yaml similarity index 100% rename from conf/task_defaults/so2sat_supervised.yaml rename to tests/conf/so2sat_supervised.yaml diff --git a/conf/task_defaults/so2sat_unsupervised.yaml b/tests/conf/so2sat_unsupervised.yaml similarity index 100% rename from conf/task_defaults/so2sat_unsupervised.yaml rename to tests/conf/so2sat_unsupervised.yaml diff --git a/conf/task_defaults/ucmerced.yaml b/tests/conf/ucmerced.yaml similarity index 100% rename from conf/task_defaults/ucmerced.yaml rename to tests/conf/ucmerced.yaml diff --git a/tests/datamodules/test_chesapeake.py b/tests/datamodules/test_chesapeake.py index 4dde9bbf428..43e79d52e6e 100644 --- a/tests/datamodules/test_chesapeake.py +++ b/tests/datamodules/test_chesapeake.py @@ -14,9 +14,7 @@ class TestChesapeakeCVPRDataModule: @pytest.fixture(scope="class") def datamodule(self) -> ChesapeakeCVPRDataModule: - conf = OmegaConf.load( - os.path.join("conf", "task_defaults", "chesapeake_cvpr_5.yaml") - ) + conf = OmegaConf.load(os.path.join("tests", "conf", "chesapeake_cvpr_5.yaml")) kwargs = OmegaConf.to_object(conf.experiment.datamodule) kwargs = cast(Dict[str, Any], kwargs) diff --git a/tests/trainers/test_byol.py b/tests/trainers/test_byol.py index d8f363f7e79..44fec8c766c 100644 --- a/tests/trainers/test_byol.py +++ b/tests/trainers/test_byol.py @@ -43,7 +43,7 @@ class TestBYOLTask: ], ) def test_trainer(self, name: str, classname: Type[LightningDataModule]) -> None: - conf = OmegaConf.load(os.path.join("conf", "task_defaults", name + ".yaml")) + conf = OmegaConf.load(os.path.join("tests", "conf", name + ".yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict) diff --git a/tests/trainers/test_classification.py b/tests/trainers/test_classification.py index fa5e2a99585..1ec48e9ae23 100644 --- a/tests/trainers/test_classification.py +++ b/tests/trainers/test_classification.py @@ -47,7 +47,7 @@ def test_trainer( if name.startswith("so2sat"): pytest.importorskip("h5py") - conf = OmegaConf.load(os.path.join("conf", "task_defaults", name + ".yaml")) + conf = OmegaConf.load(os.path.join("tests", "conf", name + ".yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict) @@ -68,7 +68,7 @@ def test_trainer( trainer.test(model=model, datamodule=datamodule) def test_no_logger(self) -> None: - conf = OmegaConf.load(os.path.join("conf", "task_defaults", "ucmerced.yaml")) + conf = OmegaConf.load(os.path.join("tests", "conf", "ucmerced.yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict) @@ -142,7 +142,7 @@ def test_trainer( name: str, classname: Type[LightningDataModule], ) -> None: - conf = OmegaConf.load(os.path.join("conf", "task_defaults", name + ".yaml")) + conf = OmegaConf.load(os.path.join("tests", "conf", name + ".yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict) @@ -163,9 +163,7 @@ def test_trainer( trainer.test(model=model, datamodule=datamodule) def test_no_logger(self) -> None: - conf = OmegaConf.load( - os.path.join("conf", "task_defaults", "bigearthnet_s1.yaml") - ) + conf = OmegaConf.load(os.path.join("tests", "conf", "bigearthnet_s1.yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict) diff --git a/tests/trainers/test_regression.py b/tests/trainers/test_regression.py index 056d98591db..9a56a526e79 100644 --- a/tests/trainers/test_regression.py +++ b/tests/trainers/test_regression.py @@ -20,7 +20,7 @@ class TestRegressionTask: [("cowc_counting", COWCCountingDataModule), ("cyclone", CycloneDataModule)], ) def test_trainer(self, name: str, classname: Type[LightningDataModule]) -> None: - conf = OmegaConf.load(os.path.join("conf", "task_defaults", name + ".yaml")) + conf = OmegaConf.load(os.path.join("tests", "conf", name + ".yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict) @@ -40,7 +40,7 @@ def test_trainer(self, name: str, classname: Type[LightningDataModule]) -> None: trainer.test(model=model, datamodule=datamodule) def test_no_logger(self) -> None: - conf = OmegaConf.load(os.path.join("conf", "task_defaults", "cyclone.yaml")) + conf = OmegaConf.load(os.path.join("tests", "conf", "cyclone.yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict) diff --git a/tests/trainers/test_segmentation.py b/tests/trainers/test_segmentation.py index f0c0b3ae853..61323df89cc 100644 --- a/tests/trainers/test_segmentation.py +++ b/tests/trainers/test_segmentation.py @@ -50,7 +50,7 @@ def test_trainer( name: str, classname: Type[LightningDataModule], ) -> None: - conf = OmegaConf.load(os.path.join("conf", "task_defaults", name + ".yaml")) + conf = OmegaConf.load(os.path.join("tests", "conf", name + ".yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict) @@ -72,7 +72,7 @@ def test_trainer( trainer.test(model=model, datamodule=datamodule) def test_no_logger(self) -> None: - conf = OmegaConf.load(os.path.join("conf", "task_defaults", "landcoverai.yaml")) + conf = OmegaConf.load(os.path.join("tests", "conf", "landcoverai.yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict) diff --git a/train.py b/train.py index 31c8ce71c47..101ecc6e9f1 100755 --- a/train.py +++ b/train.py @@ -39,28 +39,19 @@ TASK_TO_MODULES_MAPPING: Dict[ str, Tuple[Type[pl.LightningModule], Type[pl.LightningDataModule]] ] = { - "bigearthnet_all": (MultiLabelClassificationTask, BigEarthNetDataModule), - "bigearthnet_s1": (MultiLabelClassificationTask, BigEarthNetDataModule), - "bigearthnet_s2": (MultiLabelClassificationTask, BigEarthNetDataModule), + "bigearthnet": (MultiLabelClassificationTask, BigEarthNetDataModule), "byol": (BYOLTask, ChesapeakeCVPRDataModule), - "chesapeake_cvpr_5": (SemanticSegmentationTask, ChesapeakeCVPRDataModule), - "chesapeake_cvpr_7": (SemanticSegmentationTask, ChesapeakeCVPRDataModule), - "chesapeake_cvpr_prior": (SemanticSegmentationTask, ChesapeakeCVPRDataModule), + "chesapeake_cvpr": (SemanticSegmentationTask, ChesapeakeCVPRDataModule), "cowc_counting": (RegressionTask, COWCCountingDataModule), "cyclone": (RegressionTask, CycloneDataModule), "eurosat": (ClassificationTask, EuroSATDataModule), "etci2021": (SemanticSegmentationTask, ETCI2021DataModule), "landcoverai": (SemanticSegmentationTask, LandCoverAIDataModule), "naipchesapeake": (SemanticSegmentationTask, NAIPChesapeakeDataModule), - "oscd_all": (SemanticSegmentationTask, OSCDDataModule), - "oscd_rgb": (SemanticSegmentationTask, OSCDDataModule), + "oscd": (SemanticSegmentationTask, OSCDDataModule), "resisc45": (ClassificationTask, RESISC45DataModule), - "sen12ms_all": (SemanticSegmentationTask, SEN12MSDataModule), - "sen12ms_s1": (SemanticSegmentationTask, SEN12MSDataModule), - "sen12ms_s2_all": (SemanticSegmentationTask, SEN12MSDataModule), - "sen12ms_s2_reduced": (SemanticSegmentationTask, SEN12MSDataModule), - "so2sat_supervised": (ClassificationTask, So2SatDataModule), - "so2sat_unsupervised": (ClassificationTask, So2SatDataModule), + "sen12ms": (SemanticSegmentationTask, SEN12MSDataModule), + "so2sat": (ClassificationTask, So2SatDataModule), "ucmerced": (ClassificationTask, UCMercedDataModule), } @@ -104,7 +95,7 @@ def set_up_omegaconf() -> DictConfig: # These OmegaConf structured configs enforce a schema at runtime, see: # https://omegaconf.readthedocs.io/en/2.0_branch/structured_config.html#merging-with-other-configs task_name = conf.experiment.task - task_config_fn = os.path.join("conf", "task_defaults", f"{task_name}.yaml") + task_config_fn = os.path.join("conf", f"{task_name}.yaml") if task_name == "test": task_conf = OmegaConf.create() elif os.path.exists(task_config_fn):