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 83% rename from conf/task_defaults/bigearthnet_all.yaml rename to tests/conf/bigearthnet_all.yaml index ba55f85e709..098279d7436 100644 --- a/conf/task_defaults/bigearthnet_all.yaml +++ b/tests/conf/bigearthnet_all.yaml @@ -3,8 +3,6 @@ experiment: module: loss: "bce" classification_model: "resnet18" - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 weights: "random" in_channels: 14 num_classes: 19 diff --git a/conf/task_defaults/bigearthnet_s1.yaml b/tests/conf/bigearthnet_s1.yaml similarity index 83% rename from conf/task_defaults/bigearthnet_s1.yaml rename to tests/conf/bigearthnet_s1.yaml index 73e727a04ea..b2ffce92349 100644 --- a/conf/task_defaults/bigearthnet_s1.yaml +++ b/tests/conf/bigearthnet_s1.yaml @@ -3,8 +3,6 @@ experiment: module: loss: "bce" classification_model: "resnet18" - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 weights: "random" in_channels: 2 num_classes: 19 diff --git a/conf/task_defaults/bigearthnet_s2.yaml b/tests/conf/bigearthnet_s2.yaml similarity index 83% rename from conf/task_defaults/bigearthnet_s2.yaml rename to tests/conf/bigearthnet_s2.yaml index 9b9983a461d..13e87b508ce 100644 --- a/conf/task_defaults/bigearthnet_s2.yaml +++ b/tests/conf/bigearthnet_s2.yaml @@ -3,8 +3,6 @@ experiment: module: loss: "bce" classification_model: "resnet18" - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 weights: "random" in_channels: 12 num_classes: 19 diff --git a/conf/task_defaults/byol.yaml b/tests/conf/byol.yaml similarity index 84% rename from conf/task_defaults/byol.yaml rename to tests/conf/byol.yaml index d79b0def86c..598c7709730 100644 --- a/conf/task_defaults/byol.yaml +++ b/tests/conf/byol.yaml @@ -6,8 +6,6 @@ experiment: encoder: "resnet18" input_channels: 4 imagenet_pretraining: False - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 datamodule: root_dir: "tests/data/chesapeake/cvpr" train_splits: diff --git a/conf/task_defaults/chesapeake_cvpr_5.yaml b/tests/conf/chesapeake_cvpr_5.yaml similarity index 90% rename from conf/task_defaults/chesapeake_cvpr_5.yaml rename to tests/conf/chesapeake_cvpr_5.yaml index 63b0b469f42..232678e49b3 100644 --- a/conf/task_defaults/chesapeake_cvpr_5.yaml +++ b/tests/conf/chesapeake_cvpr_5.yaml @@ -6,8 +6,6 @@ experiment: encoder_name: "resnet50" encoder_weights: null encoder_output_stride: 16 - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 in_channels: 4 num_classes: 5 num_filters: 1 diff --git a/conf/task_defaults/chesapeake_cvpr_7.yaml b/tests/conf/chesapeake_cvpr_7.yaml similarity index 90% rename from conf/task_defaults/chesapeake_cvpr_7.yaml rename to tests/conf/chesapeake_cvpr_7.yaml index b1cd0bde844..44f9257cbfe 100644 --- a/conf/task_defaults/chesapeake_cvpr_7.yaml +++ b/tests/conf/chesapeake_cvpr_7.yaml @@ -6,8 +6,6 @@ experiment: encoder_name: "resnet18" encoder_weights: null encoder_output_stride: 16 - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 in_channels: 4 num_classes: 7 num_filters: 1 diff --git a/conf/task_defaults/chesapeake_cvpr_prior.yaml b/tests/conf/chesapeake_cvpr_prior.yaml similarity index 90% rename from conf/task_defaults/chesapeake_cvpr_prior.yaml rename to tests/conf/chesapeake_cvpr_prior.yaml index ab7398da3b9..06ca5edd037 100644 --- a/conf/task_defaults/chesapeake_cvpr_prior.yaml +++ b/tests/conf/chesapeake_cvpr_prior.yaml @@ -6,8 +6,6 @@ experiment: encoder_name: "resnet50" encoder_weights: null encoder_output_stride: 16 - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 in_channels: 4 num_classes: 5 num_filters: 1 diff --git a/conf/task_defaults/cowc_counting.yaml b/tests/conf/cowc_counting.yaml similarity index 75% rename from conf/task_defaults/cowc_counting.yaml rename to tests/conf/cowc_counting.yaml index 4a4ab2f9abb..30e2f22f317 100644 --- a/conf/task_defaults/cowc_counting.yaml +++ b/tests/conf/cowc_counting.yaml @@ -2,8 +2,6 @@ experiment: task: cowc_counting module: model: resnet18 - learning_rate: 1e-3 - learning_rate_schedule_patience: 2 pretrained: False datamodule: root_dir: "tests/data/cowc_counting" diff --git a/conf/task_defaults/cyclone.yaml b/tests/conf/cyclone.yaml similarity index 74% rename from conf/task_defaults/cyclone.yaml rename to tests/conf/cyclone.yaml index ba3d039f9d7..3af3f2e68ba 100644 --- a/conf/task_defaults/cyclone.yaml +++ b/tests/conf/cyclone.yaml @@ -2,8 +2,6 @@ experiment: task: "cyclone" module: model: "resnet18" - learning_rate: 1e-3 - learning_rate_schedule_patience: 2 pretrained: False datamodule: root_dir: "tests/data/cyclone" diff --git a/conf/task_defaults/etci2021.yaml b/tests/conf/etci2021.yaml similarity index 82% rename from conf/task_defaults/etci2021.yaml rename to tests/conf/etci2021.yaml index 880ac6232e6..3d92037013e 100644 --- a/conf/task_defaults/etci2021.yaml +++ b/tests/conf/etci2021.yaml @@ -5,8 +5,6 @@ experiment: segmentation_model: "unet" encoder_name: "resnet18" encoder_weights: null - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 in_channels: 7 num_classes: 2 ignore_zeros: True diff --git a/conf/task_defaults/eurosat.yaml b/tests/conf/eurosat.yaml similarity index 79% rename from conf/task_defaults/eurosat.yaml rename to tests/conf/eurosat.yaml index 2f288b56bdd..06291be11b5 100644 --- a/conf/task_defaults/eurosat.yaml +++ b/tests/conf/eurosat.yaml @@ -3,8 +3,6 @@ experiment: module: loss: "ce" classification_model: "resnet18" - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 weights: "random" in_channels: 13 num_classes: 2 diff --git a/conf/task_defaults/landcoverai.yaml b/tests/conf/landcoverai.yaml similarity index 84% rename from conf/task_defaults/landcoverai.yaml rename to tests/conf/landcoverai.yaml index 4e28b018935..4afbb7d3b94 100644 --- a/conf/task_defaults/landcoverai.yaml +++ b/tests/conf/landcoverai.yaml @@ -5,8 +5,6 @@ experiment: segmentation_model: "unet" encoder_name: "resnet18" encoder_weights: null - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 verbose: false in_channels: 3 num_classes: 6 diff --git a/conf/task_defaults/naipchesapeake.yaml b/tests/conf/naipchesapeake.yaml similarity index 87% rename from conf/task_defaults/naipchesapeake.yaml rename to tests/conf/naipchesapeake.yaml index 83814f3316a..964f9e7363f 100644 --- a/conf/task_defaults/naipchesapeake.yaml +++ b/tests/conf/naipchesapeake.yaml @@ -6,8 +6,6 @@ experiment: encoder_name: "resnet34" encoder_weights: null encoder_output_stride: 16 - learning_rate: 1e-3 - learning_rate_schedule_patience: 2 in_channels: 4 num_classes: 13 num_filters: 1 diff --git a/conf/task_defaults/oscd_all.yaml b/tests/conf/oscd_all.yaml similarity index 87% rename from conf/task_defaults/oscd_all.yaml rename to tests/conf/oscd_all.yaml index 00dc28a90c1..1a11e3cf1a0 100644 --- a/conf/task_defaults/oscd_all.yaml +++ b/tests/conf/oscd_all.yaml @@ -5,8 +5,6 @@ experiment: segmentation_model: "unet" encoder_name: "resnet18" encoder_weights: null - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 verbose: false in_channels: 26 num_classes: 2 diff --git a/conf/task_defaults/oscd_rgb.yaml b/tests/conf/oscd_rgb.yaml similarity index 87% rename from conf/task_defaults/oscd_rgb.yaml rename to tests/conf/oscd_rgb.yaml index 762efab1515..242a5a773c3 100644 --- a/conf/task_defaults/oscd_rgb.yaml +++ b/tests/conf/oscd_rgb.yaml @@ -5,8 +5,6 @@ experiment: segmentation_model: "unet" encoder_name: "resnet18" encoder_weights: null - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 verbose: false in_channels: 6 num_classes: 2 diff --git a/conf/task_defaults/resisc45.yaml b/tests/conf/resisc45.yaml similarity index 79% rename from conf/task_defaults/resisc45.yaml rename to tests/conf/resisc45.yaml index 8e46b26ecca..a2a9c1836e7 100644 --- a/conf/task_defaults/resisc45.yaml +++ b/tests/conf/resisc45.yaml @@ -3,8 +3,6 @@ experiment: module: loss: "ce" classification_model: "resnet18" - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 weights: "random" in_channels: 3 num_classes: 3 diff --git a/conf/task_defaults/sen12ms_all.yaml b/tests/conf/sen12ms_all.yaml similarity index 84% rename from conf/task_defaults/sen12ms_all.yaml rename to tests/conf/sen12ms_all.yaml index 1a0f73fddd4..37844c9e07e 100644 --- a/conf/task_defaults/sen12ms_all.yaml +++ b/tests/conf/sen12ms_all.yaml @@ -6,8 +6,6 @@ experiment: 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 diff --git a/conf/task_defaults/sen12ms_s1.yaml b/tests/conf/sen12ms_s1.yaml similarity index 85% rename from conf/task_defaults/sen12ms_s1.yaml rename to tests/conf/sen12ms_s1.yaml index a2fdbb17031..fb987e52f11 100644 --- a/conf/task_defaults/sen12ms_s1.yaml +++ b/tests/conf/sen12ms_s1.yaml @@ -7,8 +7,6 @@ experiment: encoder_name: "resnet18" encoder_weights: null encoder_output_stride: 16 - learning_rate: 1e-3 - learning_rate_schedule_patience: 2 in_channels: 2 num_classes: 11 ignore_zeros: False diff --git a/conf/task_defaults/sen12ms_s2_all.yaml b/tests/conf/sen12ms_s2_all.yaml similarity index 84% rename from conf/task_defaults/sen12ms_s2_all.yaml rename to tests/conf/sen12ms_s2_all.yaml index eb081ef722f..c20738d1f9d 100644 --- a/conf/task_defaults/sen12ms_s2_all.yaml +++ b/tests/conf/sen12ms_s2_all.yaml @@ -6,8 +6,6 @@ experiment: encoder_name: "resnet18" encoder_weights: null encoder_output_stride: 16 - learning_rate: 1e-3 - learning_rate_schedule_patience: 2 in_channels: 13 num_classes: 11 ignore_zeros: False diff --git a/conf/task_defaults/sen12ms_s2_reduced.yaml b/tests/conf/sen12ms_s2_reduced.yaml similarity index 85% rename from conf/task_defaults/sen12ms_s2_reduced.yaml rename to tests/conf/sen12ms_s2_reduced.yaml index e44c20a3dbd..1c004a7805c 100644 --- a/conf/task_defaults/sen12ms_s2_reduced.yaml +++ b/tests/conf/sen12ms_s2_reduced.yaml @@ -6,8 +6,6 @@ experiment: encoder_name: "resnet18" encoder_weights: null encoder_output_stride: 16 - learning_rate: 1e-3 - learning_rate_schedule_patience: 2 in_channels: 6 num_classes: 11 ignore_zeros: False diff --git a/conf/task_defaults/so2sat_supervised.yaml b/tests/conf/so2sat_supervised.yaml similarity index 81% rename from conf/task_defaults/so2sat_supervised.yaml rename to tests/conf/so2sat_supervised.yaml index 0f215c24c84..705519370fa 100644 --- a/conf/task_defaults/so2sat_supervised.yaml +++ b/tests/conf/so2sat_supervised.yaml @@ -3,8 +3,6 @@ experiment: module: loss: "focal" classification_model: "resnet18" - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 weights: "random" in_channels: 3 num_classes: 17 diff --git a/conf/task_defaults/so2sat_unsupervised.yaml b/tests/conf/so2sat_unsupervised.yaml similarity index 82% rename from conf/task_defaults/so2sat_unsupervised.yaml rename to tests/conf/so2sat_unsupervised.yaml index ec51d18c4a6..d714f9d575b 100644 --- a/conf/task_defaults/so2sat_unsupervised.yaml +++ b/tests/conf/so2sat_unsupervised.yaml @@ -3,8 +3,6 @@ experiment: module: loss: "jaccard" classification_model: "resnet18" - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 weights: "random" in_channels: 3 num_classes: 17 diff --git a/conf/task_defaults/ucmerced.yaml b/tests/conf/ucmerced.yaml similarity index 79% rename from conf/task_defaults/ucmerced.yaml rename to tests/conf/ucmerced.yaml index 04de488a7e3..3c36b2dc639 100644 --- a/conf/task_defaults/ucmerced.yaml +++ b/tests/conf/ucmerced.yaml @@ -4,8 +4,6 @@ experiment: loss: "ce" classification_model: "resnet18" weights: "random" - learning_rate: 1e-3 - learning_rate_schedule_patience: 6 in_channels: 3 num_classes: 2 datamodule: diff --git a/tests/datamodules/test_chesapeake.py b/tests/datamodules/test_chesapeake.py index 4dde9bbf428..a16bbb2072d 100644 --- a/tests/datamodules/test_chesapeake.py +++ b/tests/datamodules/test_chesapeake.py @@ -15,7 +15,7 @@ class TestChesapeakeCVPRDataModule: @pytest.fixture(scope="class") def datamodule(self) -> ChesapeakeCVPRDataModule: conf = OmegaConf.load( - os.path.join("conf", "task_defaults", "chesapeake_cvpr_5.yaml") + 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..efc38fb12b8 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) @@ -164,7 +164,7 @@ def test_trainer( def test_no_logger(self) -> None: conf = OmegaConf.load( - os.path.join("conf", "task_defaults", "bigearthnet_s1.yaml") + 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):