Skip to content

Commit 7724972

Browse files
Checking if the fine-tune command returned 0
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
1 parent e2cebea commit 7724972

5 files changed

+10
-10
lines changed

tests/manufactured-finetune_prithvi_swin_B.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ model:
9898
pretrained: true
9999
backbone: prithvi_swin_B
100100
backbone_pretrained_cfg_overlay:
101-
file: /tmp/prithvi_swin_B.pt
101+
file: tests/prithvi_swin_B.pt
102102
backbone_drop_path_rate: 0.3
103103
# backbone_window_size: 8
104104
decoder_channels: 256

tests/manufactured-finetune_prithvi_swin_L.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ model:
9898
pretrained: true
9999
backbone: prithvi_swin_L
100100
backbone_pretrained_cfg_overlay:
101-
file: /tmp/prithvi_swin_L.pt
101+
file: tests/prithvi_swin_L.pt
102102
backbone_drop_path_rate: 0.3
103103
# backbone_window_size: 8
104104
decoder_channels: 64

tests/manufactured-finetune_prithvi_vit_100.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ model:
9898
pretrained: true
9999
backbone: prithvi_vit_100
100100
backbone_pretrained_cfg_overlay:
101-
file: /tmp/prithvi_vit_100.pt
101+
file: tests/prithvi_vit_100.pt
102102
backbone_drop_path_rate: 0.3
103103
num_frames: 1
104104
# backbone_window_size: 8

tests/manufactured-finetune_prithvi_vit_300.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ model:
9898
pretrained: true
9999
backbone: prithvi_vit_300
100100
backbone_pretrained_cfg_overlay:
101-
file: /tmp/prithvi_vit_300.pt
101+
file: tests/prithvi_vit_300.pt
102102
backbone_drop_path_rate: 0.3
103103
# backbone_window_size: 8
104104
decoder_channels: 64

tests/test_finetune.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ def test_finetune_multiple_backbones(model_name):
3434

3535
torch.save(filtered_state_dict, os.path.join("tests/", model_name + ".pt"))
3636

37-
try:
38-
# Running the terratorch CLI
39-
command_str = f"terratorch fit -c tests/manufactured-finetune_{model_name}.yaml"
37+
# Running the terratorch CLI
38+
command_str = f"terratorch fit -c tests/manufactured-finetune_{model_name}.yaml"
39+
40+
command_out = subprocess.run(command_str, shell=True)
41+
42+
assert not command_out.returncode
4043

41-
subprocess.run(command_str, shell=True)
42-
except:
43-
Exception("Fine-tuning cannot be executed.")
4444

4545

0 commit comments

Comments
 (0)