keya254 commited on
Commit
f41e217
·
verified ·
1 Parent(s): c571ace

Upload Prithvi-EO-2.0-300M crop baseline (30 epochs)

Browse files
multicrop_300m_tl/version_0/checkpoints/epoch=29.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b3513cbdd674784c4507466e8b9bc5d906db04c2d5e77e6def4f7eb38bf2892
3
+ size 3878481517
multicrop_300m_tl/version_0/checkpoints/epoch=29_state_dict.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c801e7f47dfb567bdb60b05ab421dffa04865e68ecbb878a3ebb183df2e1f07d
3
+ size 1294463628
multicrop_300m_tl/version_0/config.yaml ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # lightning.pytorch==2.6.6
2
+ seed_everything: 0
3
+ trainer:
4
+ accelerator: auto
5
+ strategy: auto
6
+ devices: '1'
7
+ num_nodes: 1
8
+ precision: 16-mixed
9
+ logger:
10
+ class_path: lightning.pytorch.loggers.TensorBoardLogger
11
+ init_args:
12
+ save_dir: outputs
13
+ name: multicrop_300m_tl
14
+ log_graph: false
15
+ default_hp_metric: true
16
+ prefix: ''
17
+ comment: ''
18
+ max_queue: 10
19
+ flush_secs: 120
20
+ filename_suffix: ''
21
+ callbacks:
22
+ - class_path: lightning.pytorch.callbacks.LearningRateMonitor
23
+ init_args:
24
+ logging_interval: epoch
25
+ log_momentum: false
26
+ log_weight_decay: false
27
+ - class_path: lightning.pytorch.callbacks.EarlyStopping
28
+ init_args:
29
+ monitor: val/loss
30
+ min_delta: 0.0
31
+ patience: 20
32
+ verbose: false
33
+ mode: min
34
+ strict: true
35
+ check_finite: true
36
+ log_rank_zero_only: false
37
+ - class_path: terratorch.cli_tools.StateDictAwareModelCheckpoint
38
+ init_args:
39
+ filename: '{epoch}'
40
+ monitor: val/loss
41
+ - class_path: terratorch.cli_tools.StateDictAwareModelCheckpoint
42
+ init_args:
43
+ filename: '{epoch}_state_dict'
44
+ save_weights_only: true
45
+ monitor: val/loss
46
+ fast_dev_run: false
47
+ max_epochs: 30
48
+ max_steps: -1
49
+ overfit_batches: 0.0
50
+ check_val_every_n_epoch: 10
51
+ log_every_n_steps: 50
52
+ enable_checkpointing: true
53
+ accumulate_grad_batches: 1
54
+ inference_mode: true
55
+ use_distributed_sampler: true
56
+ detect_anomaly: false
57
+ barebones: false
58
+ sync_batchnorm: false
59
+ reload_dataloaders_every_n_epochs: 0
60
+ default_root_dir: /outputs
61
+ enable_autolog_hparams: true
62
+ model:
63
+ class_path: terratorch.tasks.SemanticSegmentationTask
64
+ init_args:
65
+ model_args:
66
+ backbone: prithvi_eo_v2_300_tl
67
+ backbone_pretrained: true
68
+ backbone_bands:
69
+ - BLUE
70
+ - GREEN
71
+ - RED
72
+ - NIR_NARROW
73
+ - SWIR_1
74
+ - SWIR_2
75
+ backbone_coords_encoding:
76
+ - time
77
+ - location
78
+ backbone_num_frames: 3
79
+ decoder: UperNetDecoder
80
+ decoder_channels: 256
81
+ num_classes: 13
82
+ head_dropout: 0.1
83
+ rescale: true
84
+ necks:
85
+ - name: SelectIndices
86
+ indices:
87
+ - 5
88
+ - 11
89
+ - 17
90
+ - 23
91
+ - name: ReshapeTokensToImage
92
+ effective_time_dim: 3
93
+ model_factory: EncoderDecoderFactory
94
+ loss: ce
95
+ class_weights:
96
+ - 0.386375
97
+ - 0.661126
98
+ - 0.548184
99
+ - 0.640482
100
+ - 0.876862
101
+ - 0.925186
102
+ - 3.249462
103
+ - 1.542289
104
+ - 2.175141
105
+ - 2.272419
106
+ - 3.062762
107
+ - 3.626097
108
+ - 1.198702
109
+ ignore_index: -1
110
+ lr: 0.001
111
+ freeze_backbone: false
112
+ freeze_decoder: false
113
+ freeze_head: false
114
+ plot_on_val: 10
115
+ output_on_inference: prediction
116
+ output_most_probable: true
117
+ tiled_inference_on_testing: false
118
+ tiled_inference_on_validation: false
119
+ data:
120
+ class_path: terratorch.datamodules.MultiTemporalCropClassificationDataModule
121
+ init_args:
122
+ data_root: /data/multicrop
123
+ batch_size: 8
124
+ num_workers: 8
125
+ bands:
126
+ - BLUE
127
+ - GREEN
128
+ - RED
129
+ - NIR_NARROW
130
+ - SWIR_1
131
+ - SWIR_2
132
+ train_transform:
133
+ - class_path: terratorch.datasets.transforms.FlattenTemporalIntoChannels
134
+ - class_path: albumentations.HorizontalFlip
135
+ init_args:
136
+ p: 0.5
137
+ - class_path: albumentations.pytorch.ToTensorV2
138
+ init_args:
139
+ transpose_mask: false
140
+ p: 1.0
141
+ - class_path: terratorch.datasets.transforms.UnflattenTemporalFromChannels
142
+ init_args:
143
+ n_timesteps: 3
144
+ val_transform:
145
+ - class_path: terratorch.datasets.transforms.FlattenTemporalIntoChannels
146
+ - class_path: albumentations.pytorch.ToTensorV2
147
+ init_args:
148
+ transpose_mask: false
149
+ p: 1.0
150
+ - class_path: terratorch.datasets.transforms.UnflattenTemporalFromChannels
151
+ init_args:
152
+ n_timesteps: 3
153
+ drop_last: true
154
+ no_data_replace: 0.0
155
+ no_label_replace: -1
156
+ expand_temporal_dimension: true
157
+ reduce_zero_label: true
158
+ use_metadata: true
159
+ metadata_file_name: chips_df.csv
160
+ out_dtype: int16
161
+ deploy_config_file: true
162
+ optimizer:
163
+ class_path: torch.optim.AdamW
164
+ init_args:
165
+ lr: 0.0003
166
+ betas:
167
+ - 0.9
168
+ - 0.999
169
+ eps: 1.0e-08
170
+ weight_decay: 0.35
171
+ amsgrad: false
172
+ maximize: false
173
+ capturable: false
174
+ differentiable: false
175
+ lr_scheduler:
176
+ class_path: torch.optim.lr_scheduler.StepLR
177
+ init_args:
178
+ step_size: 10
179
+ gamma: 0.9
180
+ last_epoch: -1
181
+ verbose: deprecated
multicrop_300m_tl/version_0/config_deploy.yaml ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ data:
2
+ class_path: terratorch.datamodules.MultiTemporalCropClassificationDataModule
3
+ init_args:
4
+ bands:
5
+ - BLUE
6
+ - GREEN
7
+ - RED
8
+ - NIR_NARROW
9
+ - SWIR_1
10
+ - SWIR_2
11
+ batch_size: 8
12
+ data_root: /data/multicrop
13
+ drop_last: true
14
+ expand_temporal_dimension: true
15
+ metadata_file_name: chips_df.csv
16
+ no_data_replace: 0.0
17
+ no_label_replace: -1
18
+ num_workers: 8
19
+ reduce_zero_label: true
20
+ train_transform:
21
+ - class_path: terratorch.datasets.transforms.FlattenTemporalIntoChannels
22
+ - class_path: albumentations.HorizontalFlip
23
+ init_args:
24
+ p: 0.5
25
+ - class_path: albumentations.pytorch.ToTensorV2
26
+ init_args:
27
+ p: 1.0
28
+ transpose_mask: false
29
+ - class_path: terratorch.datasets.transforms.UnflattenTemporalFromChannels
30
+ init_args:
31
+ n_timesteps: 3
32
+ use_metadata: true
33
+ val_transform:
34
+ - class_path: terratorch.datasets.transforms.FlattenTemporalIntoChannels
35
+ - class_path: albumentations.pytorch.ToTensorV2
36
+ init_args:
37
+ p: 1.0
38
+ transpose_mask: false
39
+ - class_path: terratorch.datasets.transforms.UnflattenTemporalFromChannels
40
+ init_args:
41
+ n_timesteps: 3
42
+ deploy_config_file: true
43
+ model:
44
+ class_path: terratorch.tasks.SemanticSegmentationTask
45
+ init_args:
46
+ class_weights:
47
+ - 0.386375
48
+ - 0.661126
49
+ - 0.548184
50
+ - 0.640482
51
+ - 0.876862
52
+ - 0.925186
53
+ - 3.249462
54
+ - 1.542289
55
+ - 2.175141
56
+ - 2.272419
57
+ - 3.062762
58
+ - 3.626097
59
+ - 1.198702
60
+ freeze_backbone: false
61
+ freeze_decoder: false
62
+ freeze_head: false
63
+ ignore_index: -1
64
+ loss: ce
65
+ lr: 0.001
66
+ model_args:
67
+ backbone: prithvi_eo_v2_300_tl
68
+ backbone_bands:
69
+ - BLUE
70
+ - GREEN
71
+ - RED
72
+ - NIR_NARROW
73
+ - SWIR_1
74
+ - SWIR_2
75
+ backbone_coords_encoding:
76
+ - time
77
+ - location
78
+ backbone_num_frames: 3
79
+ backbone_pretrained: false
80
+ decoder: UperNetDecoder
81
+ decoder_channels: 256
82
+ head_dropout: 0.1
83
+ necks:
84
+ - indices:
85
+ - 5
86
+ - 11
87
+ - 17
88
+ - 23
89
+ name: SelectIndices
90
+ - effective_time_dim: 3
91
+ name: ReshapeTokensToImage
92
+ num_classes: 13
93
+ rescale: true
94
+ model_factory: EncoderDecoderFactory
95
+ output_most_probable: true
96
+ output_on_inference: prediction
97
+ plot_on_val: 10
98
+ tiled_inference_on_testing: false
99
+ tiled_inference_on_validation: false
100
+ out_dtype: int16
101
+ seed_everything: 0
102
+ trainer:
103
+ accelerator: auto
104
+ accumulate_grad_batches: 1
105
+ barebones: false
106
+ check_val_every_n_epoch: 10
107
+ detect_anomaly: false
108
+ devices: '1'
109
+ enable_autolog_hparams: true
110
+ enable_checkpointing: true
111
+ fast_dev_run: false
112
+ inference_mode: true
113
+ log_every_n_steps: 50
114
+ logger: false
115
+ max_epochs: 30
116
+ max_steps: -1
117
+ num_nodes: 1
118
+ overfit_batches: 0.0
119
+ precision: 16-mixed
120
+ reload_dataloaders_every_n_epochs: 0
121
+ strategy: auto
122
+ sync_batchnorm: false
123
+ use_distributed_sampler: true
multicrop_300m_tl/version_0/events.out.tfevents.1795688727.modal.4.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cff532ce804c0b26abe60cdc5f6b9e3747dfb1645e4de7bad17438dd47a2986f
3
+ size 789597
multicrop_300m_tl/version_0/hparams.yaml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model_args:
2
+ backbone: prithvi_eo_v2_300_tl
3
+ backbone_pretrained: true
4
+ backbone_bands:
5
+ - BLUE
6
+ - GREEN
7
+ - RED
8
+ - NIR_NARROW
9
+ - SWIR_1
10
+ - SWIR_2
11
+ backbone_coords_encoding:
12
+ - time
13
+ - location
14
+ backbone_num_frames: 3
15
+ decoder: UperNetDecoder
16
+ decoder_channels: 256
17
+ num_classes: 13
18
+ head_dropout: 0.1
19
+ rescale: true
20
+ necks:
21
+ - name: SelectIndices
22
+ indices:
23
+ - 5
24
+ - 11
25
+ - 17
26
+ - 23
27
+ - name: ReshapeTokensToImage
28
+ effective_time_dim: 3
29
+ model_factory: EncoderDecoderFactory
30
+ model: null
31
+ loss: ce
32
+ aux_heads: null
33
+ aux_loss: null
34
+ class_weights:
35
+ - 0.386375
36
+ - 0.661126
37
+ - 0.548184
38
+ - 0.640482
39
+ - 0.876862
40
+ - 0.925186
41
+ - 3.249462
42
+ - 1.542289
43
+ - 2.175141
44
+ - 2.272419
45
+ - 3.062762
46
+ - 3.626097
47
+ - 1.198702
48
+ ignore_index: -1
49
+ lr: 0.001
50
+ optimizer: null
51
+ optimizer_hparams: null
52
+ scheduler: null
53
+ scheduler_hparams: null
54
+ freeze_backbone: false
55
+ freeze_decoder: false
56
+ freeze_head: false
57
+ plot_on_val: 10
58
+ class_names: null
59
+ tiled_inference_parameters: null
60
+ test_dataloaders_names: null
61
+ lr_overrides: null
62
+ output_on_inference: prediction
63
+ output_most_probable: true
64
+ path_to_record_metrics: null
65
+ tiled_inference_on_testing: false
66
+ tiled_inference_on_validation: false
67
+ _instantiator: lightning.pytorch.cli.instantiate_module
multicrop_300m_tl/version_0/multicrop_300m_tl.yaml ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Official Prithvi-EO-2.0 multi-temporal crop segmentation baseline.
2
+ # Data: https://huggingface.co/datasets/ibm-nasa-geospatial/multi-temporal-crop-classification
3
+ # Reproduces configs/multicrop.yaml from NASA-IMPACT/Prithvi-EO-2.0 using the
4
+ # 300M-TL backbone (uses time + location metadata).
5
+ #
6
+ # Run: terratorch fit -c configs/multicrop_300m_tl.yaml
7
+ # Override epochs: terratorch fit -c configs/multicrop_300m_tl.yaml --trainer.max_epochs 30
8
+
9
+ seed_everything: 0
10
+ trainer:
11
+ accelerator: auto
12
+ strategy: auto
13
+ devices: auto
14
+ num_nodes: 1
15
+ precision: 16-mixed
16
+ logger:
17
+ class_path: lightning.pytorch.loggers.TensorBoardLogger
18
+ init_args:
19
+ save_dir: outputs
20
+ name: multicrop_300m_tl
21
+ callbacks:
22
+ - class_path: lightning.pytorch.callbacks.LearningRateMonitor
23
+ init_args:
24
+ logging_interval: epoch
25
+ - class_path: lightning.pytorch.callbacks.EarlyStopping
26
+ init_args:
27
+ patience: 20
28
+ monitor: val/loss
29
+ max_epochs: 125
30
+ check_val_every_n_epoch: 10
31
+ log_every_n_steps: 50
32
+ enable_checkpointing: true
33
+ default_root_dir: outputs
34
+
35
+ data:
36
+ class_path: terratorch.datamodules.MultiTemporalCropClassificationDataModule
37
+ init_args:
38
+ batch_size: 8
39
+ num_workers: 8
40
+ reduce_zero_label: true
41
+ expand_temporal_dimension: true
42
+ use_metadata: true
43
+ bands:
44
+ - BLUE
45
+ - GREEN
46
+ - RED
47
+ - NIR_NARROW
48
+ - SWIR_1
49
+ - SWIR_2
50
+ train_transform:
51
+ - class_path: terratorch.datasets.transforms.FlattenTemporalIntoChannels
52
+ - class_path: albumentations.HorizontalFlip
53
+ - class_path: albumentations.pytorch.ToTensorV2
54
+ - class_path: terratorch.datasets.transforms.UnflattenTemporalFromChannels
55
+ init_args:
56
+ n_timesteps: 3
57
+ val_transform:
58
+ - class_path: terratorch.datasets.transforms.FlattenTemporalIntoChannels
59
+ - class_path: albumentations.pytorch.ToTensorV2
60
+ - class_path: terratorch.datasets.transforms.UnflattenTemporalFromChannels
61
+ init_args:
62
+ n_timesteps: 3
63
+ data_root: data/multicrop
64
+
65
+ model:
66
+ class_path: terratorch.tasks.SemanticSegmentationTask
67
+ init_args:
68
+ model_args:
69
+ backbone: prithvi_eo_v2_300_tl
70
+ backbone_pretrained: true
71
+ backbone_bands:
72
+ - BLUE
73
+ - GREEN
74
+ - RED
75
+ - NIR_NARROW
76
+ - SWIR_1
77
+ - SWIR_2
78
+ backbone_coords_encoding:
79
+ - time
80
+ - location
81
+ backbone_num_frames: 3
82
+ decoder: UperNetDecoder
83
+ decoder_channels: 256
84
+ num_classes: 13
85
+ head_dropout: 0.1
86
+ rescale: true
87
+ necks:
88
+ - name: SelectIndices
89
+ indices: [5, 11, 17, 23] # prithvi_eo_v2_300
90
+ - name: ReshapeTokensToImage
91
+ effective_time_dim: 3
92
+ loss: ce
93
+ ignore_index: -1
94
+ class_weights:
95
+ [0.386375, 0.661126, 0.548184, 0.640482, 0.876862, 0.925186,
96
+ 3.249462, 1.542289, 2.175141, 2.272419, 3.062762, 3.626097, 1.198702]
97
+ freeze_backbone: false
98
+ freeze_decoder: false
99
+ model_factory: EncoderDecoderFactory
100
+
101
+ optimizer:
102
+ class_path: torch.optim.AdamW
103
+ init_args:
104
+ lr: 0.0003
105
+ weight_decay: 0.35
106
+
107
+ lr_scheduler:
108
+ class_path: torch.optim.lr_scheduler.StepLR
109
+ init_args:
110
+ step_size: 10
111
+ gamma: 0.9