Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the setting of regression tests according to the introducing early-stopping #2885

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/otx/recipe/_base_/train.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
max_epochs: 10
max_epochs: 200
min_epochs: 1
callbacks:
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
monitor: null
mode: max
patience: 10 # will be updated at the optimization phase. It needs to differentiate for each tasks.
patience: 10
check_on_train_epoch_end: false
min_delta: 0.001
- class_path: lightning.pytorch.callbacks.RichProgressBar
Expand Down
26 changes: 6 additions & 20 deletions tests/regression/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class TestMultiClassCls(BaseTest):
data_root=Path("multiclass_classification/multiclass_CUB_small") / f"{idx}",
data_format="imagenet_with_subset_dirs",
num_classes=2,
extra_overrides={"max_epochs": "20"},
)
for idx in range(1, 4)
] + [
Expand All @@ -124,14 +123,12 @@ class TestMultiClassCls(BaseTest):
data_root=Path("multiclass_classification/multiclass_CUB_medium"),
data_format="imagenet_with_subset_dirs",
num_classes=67,
extra_overrides={"max_epochs": "20"},
),
DatasetTestCase(
name=f"multiclass_food101_large",
data_root=Path("multiclass_classification/multiclass_food101_large"),
data_format="imagenet_with_subset_dirs",
num_classes=20,
extra_overrides={"max_epochs": "20"},
)
]

Expand Down Expand Up @@ -181,7 +178,6 @@ class TestMultilabelCls(BaseTest):
data_root=Path("multilabel_classification/multilabel_CUB_small") / f"{idx}",
data_format="datumaro",
num_classes=3,
extra_overrides={"max_epochs": "20"},
)
for idx in range(1, 4)
] + [
Expand All @@ -190,14 +186,12 @@ class TestMultilabelCls(BaseTest):
data_root=Path("multilabel_classification/multilabel_CUB_medium"),
data_format="datumaro",
num_classes=68,
extra_overrides={"max_epochs": "20"},
),
DatasetTestCase(
name=f"multilabel_food101_large",
data_root=Path("multilabel_classification/multilabel_food101_large"),
data_format="datumaro",
num_classes=21,
extra_overrides={"max_epochs": "20"},
)
]

Expand Down Expand Up @@ -248,7 +242,6 @@ class TestHlabelCls(BaseTest):
data_format="datumaro",
num_classes=6,
extra_overrides={
"max_epochs": "20",
"model.num_multiclass_heads": "3",
"model.num_multilabel_classes": "0",
},
Expand All @@ -261,7 +254,6 @@ class TestHlabelCls(BaseTest):
data_format="datumaro",
num_classes=102,
extra_overrides={
"max_epochs": "20",
"model.num_multiclass_heads": "23",
"model.num_multilabel_classes": "0",
},
Expand Down Expand Up @@ -318,7 +310,7 @@ class TestObjectDetection(BaseTest):
data_root=Path("detection/pothole_small") / f"{idx}",
data_format="coco",
num_classes=1,
extra_overrides={"max_epochs": "40", "deterministic": "True"},
extra_overrides={"deterministic": "True"},
)
for idx in range(1, 4)
] + [
Expand All @@ -327,14 +319,14 @@ class TestObjectDetection(BaseTest):
data_root=Path("detection/pothole_medium"),
data_format="coco",
num_classes=1,
extra_overrides={"max_epochs": "40", "deterministic": "True"}
extra_overrides={"deterministic": "True"}
),
DatasetTestCase(
name="vitens_large",
data_root=Path("detection/vitens_large"),
data_format="coco",
num_classes=1,
extra_overrides={"max_epochs": "40", "deterministic": "True"}
extra_overrides={"deterministic": "True"}
)
]

Expand Down Expand Up @@ -386,7 +378,6 @@ class TestSemanticSegmentation(BaseTest):
data_root=Path("semantic_seg/kvasir_small") / f"{idx}",
data_format="common_semantic_segmentation_with_subset_dirs",
num_classes=2,
extra_overrides={"max_epochs": "40"},
)
for idx in range(1, 4)
] + [
Expand All @@ -395,14 +386,12 @@ class TestSemanticSegmentation(BaseTest):
data_root=Path("semantic_seg/kvasir_medium"),
data_format="common_semantic_segmentation_with_subset_dirs",
num_classes=2,
extra_overrides={"max_epochs": "40"}
),
DatasetTestCase(
name="kvasir_large",
data_root=Path("semantic_seg/kvasir_large"),
data_format="common_semantic_segmentation_with_subset_dirs",
num_classes=2,
extra_overrides={"max_epochs": "40"}
)
]

Expand Down Expand Up @@ -450,7 +439,7 @@ class TestInstanceSegmentation(BaseTest):
data_root=Path("instance_seg/wgisd_small") / f"{idx}",
data_format="coco",
num_classes=5,
extra_overrides={"max_epochs": "20", "deterministic": "True"},
extra_overrides={"deterministic": "True"},
)
for idx in range(1, 4)
] + [
Expand All @@ -459,14 +448,14 @@ class TestInstanceSegmentation(BaseTest):
data_root=Path("instance_seg/coco_car_person_medium"),
data_format="coco",
num_classes=2,
extra_overrides={"max_epochs": "20", "deterministic": "True"}
extra_overrides={"deterministic": "True"}
),
DatasetTestCase(
name="vitens_coliform",
data_root=Path("instance_seg/Vitens-Coliform-coco"),
data_format="coco",
num_classes=1,
extra_overrides={"max_epochs": "20", "deterministic": "True"}
extra_overrides={"deterministic": "True"}
)
]

Expand Down Expand Up @@ -513,7 +502,6 @@ class TestVisualPrompting(BaseTest):
data_root=Path("visual_prompting/wgisd_small") / f"{idx}",
data_format="coco",
num_classes=5,
extra_overrides={"max_epochs": "20"},
)
for idx in range(1, 4)
] + [
Expand All @@ -522,14 +510,12 @@ class TestVisualPrompting(BaseTest):
data_root=Path("visual_prompting/coco_car_person_medium"),
data_format="coco",
num_classes=2,
extra_overrides={"max_epochs": "20"}
),
DatasetTestCase(
name="vitens_coliform",
data_root=Path("visual_prompting/Vitens-Coliform-coco"),
data_format="coco",
num_classes=1,
extra_overrides={"max_epochs": "20"}
)
]

Expand Down
Loading