Skip to content

Commit

Permalink
add test_evaluate_mgpu_config for
Browse files Browse the repository at this point in the history
`endoscopic_tool_segmentation`

Signed-off-by: KumoLiu <[email protected]>
  • Loading branch information
KumoLiu committed Aug 8, 2023
1 parent 40161ff commit 8a8646d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ci/unit_tests/test_endoscopic_tool_segmentation_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
}
]

TEST_CASE_2 = [ # mgpu train
{
"bundle_root": "models/endoscopic_tool_segmentation",
"validate#dataloader#num_workers": 4,
"train#deterministic_transforms#3#spatial_size": [32, 32],
}
]


class TestEndoscopicSegMGPU(unittest.TestCase):
def setUp(self):
Expand Down Expand Up @@ -72,6 +80,25 @@ def test_train_mgpu_config(self, override):
check_config=True,
)

@parameterized.expand([TEST_CASE_2])
def test_evaluate_mgpu_config(self, override):
override["dataset_dir"] = self.dataset_dir
bundle_root = override["bundle_root"]
train_file = os.path.join(bundle_root, "configs/train.json")
evaluate_file = os.path.join(bundle_root, "configs/evaluate.json")
mgpu_evaluate_file = os.path.join(bundle_root, "configs/multi_gpu_evaluate.json")
output_path = os.path.join(bundle_root, "configs/evaluate_override.json")
n_gpu = torch.cuda.device_count()
export_config_and_run_mgpu_cmd(
config_file=[train_file, evaluate_file, mgpu_evaluate_file],
logging_file=os.path.join(bundle_root, "configs/logging.conf"),
meta_file=os.path.join(bundle_root, "configs/metadata.json"),
override_dict=override,
output_path=output_path,
ngpu=n_gpu,
check_config=True,
)


if __name__ == "__main__":
unittest.main()

0 comments on commit 8a8646d

Please sign in to comment.