From cd2cbba82645acb2c6e7ff5b69877ef95ec99fe5 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Date: Fri, 24 May 2024 17:50:50 +0200 Subject: [PATCH 1/3] simplify config files for vit sen1floods11 Signed-off-by: Carlos Gomes --- examples/confs/sen1floods11_vit.yaml | 1 - examples/confs/sen1floods11_vit_local_ckpt.yaml | 2 -- 2 files changed, 3 deletions(-) diff --git a/examples/confs/sen1floods11_vit.yaml b/examples/confs/sen1floods11_vit.yaml index 806d5138..9e80b10f 100644 --- a/examples/confs/sen1floods11_vit.yaml +++ b/examples/confs/sen1floods11_vit.yaml @@ -79,7 +79,6 @@ model: decoder: FCNDecoder pretrained: true backbone: prithvi_vit_100 - backbone_pretrain_img_size: 512 decoder_channels: 256 in_channels: 6 bands: diff --git a/examples/confs/sen1floods11_vit_local_ckpt.yaml b/examples/confs/sen1floods11_vit_local_ckpt.yaml index 6cdcc3d9..a72fe092 100644 --- a/examples/confs/sen1floods11_vit_local_ckpt.yaml +++ b/examples/confs/sen1floods11_vit_local_ckpt.yaml @@ -77,7 +77,6 @@ model: decoder: FCNDecoder pretrained: true backbone: prithvi_vit_100 - backbone_pretrain_img_size: 512 backbone_embed_dim: 768 backbone_num_heads: 12 backbone_decoder_depth: 8 @@ -86,7 +85,6 @@ model: backbone_mlp_ratio: 4 backbone_patch_size: 16 backbone_in_chans: 6 - backbone_num_frames: 1 backbone_pretrained_cfg_overlay: file: examples/Prithvi_100M.pt decoder_channels: 256 From 8730aded14470ad41f5bd2ba236586fc36835db4 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Date: Fri, 24 May 2024 18:05:55 +0200 Subject: [PATCH 2/3] remove unnecessary parameters from config file Signed-off-by: Carlos Gomes --- examples/confs/sen1floods11_vit_local_ckpt.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/examples/confs/sen1floods11_vit_local_ckpt.yaml b/examples/confs/sen1floods11_vit_local_ckpt.yaml index a72fe092..62180b56 100644 --- a/examples/confs/sen1floods11_vit_local_ckpt.yaml +++ b/examples/confs/sen1floods11_vit_local_ckpt.yaml @@ -77,14 +77,6 @@ model: decoder: FCNDecoder pretrained: true backbone: prithvi_vit_100 - backbone_embed_dim: 768 - backbone_num_heads: 12 - backbone_decoder_depth: 8 - backbone_decoder_num_heads: 16 - backbone_decoder_embed_dim: 512 - backbone_mlp_ratio: 4 - backbone_patch_size: 16 - backbone_in_chans: 6 backbone_pretrained_cfg_overlay: file: examples/Prithvi_100M.pt decoder_channels: 256 From 580107b672d39cb894f514f8c13f62d4672f0996 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Date: Mon, 27 May 2024 10:46:46 +0200 Subject: [PATCH 3/3] fix bad default for in_channels Signed-off-by: Carlos Gomes --- src/terratorch/models/prithvi_model_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terratorch/models/prithvi_model_factory.py b/src/terratorch/models/prithvi_model_factory.py index ad424084..a84a35a8 100644 --- a/src/terratorch/models/prithvi_model_factory.py +++ b/src/terratorch/models/prithvi_model_factory.py @@ -32,7 +32,7 @@ def build_model( backbone: str | nn.Module, decoder: str | nn.Module, bands: list[HLSBands | int], - in_channels: int = int | None, # this should be removed, can be derived from bands. But it is a breaking change + in_channels: int | None = None, # this should be removed, can be derived from bands. But it is a breaking change num_classes: int | None = None, pretrained: bool = True, # noqa: FBT001, FBT002 num_frames: int = 1,