|
| 1 | +# lightning.pytorch==2.1.1 |
| 2 | +seed_everything: 0 |
| 3 | +trainer: |
| 4 | + accelerator: auto |
| 5 | + strategy: auto |
| 6 | + devices: auto |
| 7 | + num_nodes: 1 |
| 8 | + precision: 16-mixed |
| 9 | + logger: |
| 10 | + class_path: TensorBoardLogger |
| 11 | + init_args: |
| 12 | + save_dir: <path> |
| 13 | + name: replicate |
| 14 | + callbacks: |
| 15 | + - class_path: RichProgressBar |
| 16 | + - class_path: LearningRateMonitor |
| 17 | + init_args: |
| 18 | + logging_interval: epoch |
| 19 | + |
| 20 | + max_epochs: 200 |
| 21 | + check_val_every_n_epoch: 1 |
| 22 | + log_every_n_steps: 50 |
| 23 | + enable_checkpointing: true |
| 24 | + default_root_dir: <path> |
| 25 | + |
| 26 | +# data available at: https://huggingface.co/ibm-nasa-geospatial/Prithvi-100M-multi-temporal-crop-classification |
| 27 | +data: |
| 28 | + class_path: GenericNonGeoSegmentationDataModule |
| 29 | + init_args: |
| 30 | + batch_size: 8 |
| 31 | + num_workers: 12 |
| 32 | + train_transform: |
| 33 | + - class_path: FlattenTemporalIntoChannels |
| 34 | + - class_path: albumentations.Flip |
| 35 | + - class_path: ToTensorV2 |
| 36 | + - class_path: UnflattenTemporalFromChannels |
| 37 | + init_args: |
| 38 | + n_timesteps: 3 |
| 39 | + |
| 40 | + dataset_bands: |
| 41 | + - BLUE |
| 42 | + - GREEN |
| 43 | + - RED |
| 44 | + - NIR_NARROW |
| 45 | + - SWIR_1 |
| 46 | + - SWIR_2 |
| 47 | + output_bands: |
| 48 | + - BLUE |
| 49 | + - GREEN |
| 50 | + - RED |
| 51 | + - NIR_NARROW |
| 52 | + - SWIR_1 |
| 53 | + - SWIR_2 |
| 54 | + rgb_indices: |
| 55 | + - 2 |
| 56 | + - 1 |
| 57 | + - 0 |
| 58 | + reduce_zero_label: True |
| 59 | + expand_temporal_dimension: True |
| 60 | + train_data_root: <data_path>/training_chips |
| 61 | + train_label_data_root: <data_path>/training_chips |
| 62 | + val_data_root: <data_path>/validation_chips |
| 63 | + val_label_data_root: <data_path>/validation_chips |
| 64 | + test_data_root: <data_path>/validation_chips |
| 65 | + test_label_data_root: <data_path>/validation_chips |
| 66 | + train_split: <data_path>/training_chips/training_data.txt |
| 67 | + test_split: <data_path>/validation_chips/validation_data.txt |
| 68 | + val_split: <data_path>/validation_chips/validation_data.txt |
| 69 | + img_grep: "*_merged.tif" |
| 70 | + label_grep: "*.mask.tif" |
| 71 | + means: |
| 72 | + - 494.905781 |
| 73 | + - 815.239594 |
| 74 | + - 924.335066 |
| 75 | + - 2968.881459 |
| 76 | + - 2634.621962 |
| 77 | + - 1739.579917 |
| 78 | + stds: |
| 79 | + - 284.925432 |
| 80 | + - 357.84876 |
| 81 | + - 575.566823 |
| 82 | + - 896.601013 |
| 83 | + - 951.900334 |
| 84 | + - 921.407808 |
| 85 | + num_classes: 13 |
| 86 | + |
| 87 | +model: |
| 88 | + class_path: terratorch.tasks.SemanticSegmentationTask |
| 89 | + init_args: |
| 90 | + model_args: |
| 91 | + decoder: FCNDecoder |
| 92 | + pretrained: true |
| 93 | + backbone: prithvi_vit_100 |
| 94 | + in_channels: 6 |
| 95 | + rescale: False |
| 96 | + bands: |
| 97 | + - BLUE |
| 98 | + - GREEN |
| 99 | + - RED |
| 100 | + - NIR_NARROW |
| 101 | + - SWIR_1 |
| 102 | + - SWIR_2 |
| 103 | + num_frames: 3 |
| 104 | + num_classes: 13 |
| 105 | + head_dropout: 0.1 |
| 106 | + decoder_channels: 512 |
| 107 | + head_channel_list: |
| 108 | + - 128 |
| 109 | + - 64 |
| 110 | + loss: ce |
| 111 | + class_names: |
| 112 | + - Natural Vegetation |
| 113 | + - Forest |
| 114 | + - Corn |
| 115 | + - Soybeans |
| 116 | + - Wetlands |
| 117 | + - Developed/Barren |
| 118 | + - Open Water |
| 119 | + - Winter Wheat |
| 120 | + - Alfalfa |
| 121 | + - Fallow/Idle Cropland |
| 122 | + - Cotton |
| 123 | + - Sorghum |
| 124 | + - Other |
| 125 | + # aux_heads: |
| 126 | + # - name: aux_head |
| 127 | + # decoder: FCNDecoder |
| 128 | + # decoder_args: |
| 129 | + # decoder_channels: 256 |
| 130 | + # decoder_in_index: 2 |
| 131 | + # decoder_num_convs: 2 |
| 132 | + # head_channel_list: |
| 133 | + # - 64 |
| 134 | + # aux_loss: |
| 135 | + # aux_head: 1.0 |
| 136 | + class_weights: |
| 137 | + - 0.386375 |
| 138 | + - 0.661126 |
| 139 | + - 0.548184 |
| 140 | + - 0.640482 |
| 141 | + - 0.876862 |
| 142 | + - 0.925186 |
| 143 | + - 3.249462 |
| 144 | + - 1.542289 |
| 145 | + - 2.175141 |
| 146 | + - 2.272419 |
| 147 | + - 3.062762 |
| 148 | + - 3.626097 |
| 149 | + - 1.198702 |
| 150 | + |
| 151 | + ignore_index: -1 |
| 152 | + freeze_backbone: false |
| 153 | + freeze_decoder: false |
| 154 | + model_factory: PrithviModelFactory |
| 155 | + tiled_inference_parameters: |
| 156 | + h_crop: 224 |
| 157 | + h_stride: 196 |
| 158 | + w_crop: 224 |
| 159 | + w_stride: 196 |
| 160 | + average_patches: true |
| 161 | +optimizer: |
| 162 | + class_path: torch.optim.AdamW |
| 163 | + init_args: |
| 164 | + lr: 1.5e-5 |
| 165 | + weight_decay: 0.05 |
| 166 | +lr_scheduler: |
| 167 | + class_path: ReduceLROnPlateau |
| 168 | + init_args: |
| 169 | + monitor: val/loss |
0 commit comments