From 067bf345391d389e3a22606bb0e9a593f0d4aa25 Mon Sep 17 00:00:00 2001 From: revital Date: Sun, 6 Aug 2023 11:20:45 +0300 Subject: [PATCH 1/4] Add ClearML as dependency --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index 65d5bce2c7..9cd1d59f95 100644 --- a/setup.cfg +++ b/setup.cfg @@ -126,6 +126,8 @@ mlflow = mlflow matplotlib = matplotlib +clearml = + clearml tensorboardX = tensorboardX pyyaml = From 2b3213f5a1c3542d8a519b41f8c5a72ccea767aa Mon Sep 17 00:00:00 2001 From: revital Date: Mon, 7 Aug 2023 07:19:32 +0300 Subject: [PATCH 2/4] Add ClearML as dependency --- monai/config/deviceconfig.py | 1 + 1 file changed, 1 insertion(+) diff --git a/monai/config/deviceconfig.py b/monai/config/deviceconfig.py index 1bd5f1a4cd..5d7aee6c75 100644 --- a/monai/config/deviceconfig.py +++ b/monai/config/deviceconfig.py @@ -84,6 +84,7 @@ def get_optional_config_values(): output["transformers"] = get_package_version("transformers") output["mlflow"] = get_package_version("mlflow") output["pynrrd"] = get_package_version("nrrd") + output["clearml"] = get_package_version("clearml") return output From b931e5111a4adccbd3c49a5cbfbac83b6e5b3d13 Mon Sep 17 00:00:00 2001 From: revital Date: Mon, 7 Aug 2023 08:17:17 +0300 Subject: [PATCH 3/4] DCO Remediation Commit for revital I, revital , hereby add my Signed-off-by to this commit: 067bf345391d389e3a22606bb0e9a593f0d4aa25 I, revital , hereby add my Signed-off-by to this commit: 2b3213f5a1c3542d8a519b41f8c5a72ccea767aa Signed-off-by: revital --- monai/handlers/clearml_handlers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monai/handlers/clearml_handlers.py b/monai/handlers/clearml_handlers.py index f4d6f197d2..1cfd6a33fb 100644 --- a/monai/handlers/clearml_handlers.py +++ b/monai/handlers/clearml_handlers.py @@ -45,7 +45,7 @@ def __init__( project_name: ClearML project name, default to 'MONAI'. task_name: ClearML task name, default to 'monai_experiment'. output_uri: The default location for output models and other artifacts, default to 'True'. - tags: A list of tags (str) to the created Task, default to 'None'. + tags: Add a list of tags (str) to the created Task, default to 'None'. reuse_last_task_id: Force a new Task (experiment) with a previously used Task ID, default to 'True'. continue_last_task: Continue the execution of a previously executed Task (experiment), default to 'False'. auto_connect_frameworks: Automatically connect frameworks, default to 'True'. @@ -104,7 +104,7 @@ def __init__( project_name: ClearML project name, default to 'MONAI'. task_name: ClearML task name, default to 'monai_experiment'. output_uri: The default location for output models and other artifacts, default to 'True'. - tags: A list of tags (str) to the created Task, default to 'None'. + tags: Add a list of tags (str) to the created Task, default to 'None'. reuse_last_task_id: Force a new Task (experiment) with a previously used Task ID, default to 'True'. continue_last_task: Continue the execution of a previously executed Task (experiment), default to 'False'. auto_connect_frameworks: Automatically connect frameworks, default to 'True'. @@ -155,7 +155,7 @@ def __init__( project_name: ClearML project name, default to 'MONAI'. task_name: ClearML task name, default to 'monai_experiment'. output_uri: The default location for output models and other artifacts, default to 'True'. - tags: A list of tags (str) to the created Task, default to 'None'. + tags: Add a list of tags (str) to the created Task, default to 'None'. reuse_last_task_id: Force a new Task (experiment) with a previously used Task ID, default to 'True'. continue_last_task: Continue the execution of a previously executed Task (experiment), default to 'False'. auto_connect_frameworks: Automatically connect frameworks, default to 'True'. From 52f04932f2ca9b5590f062315505f8c93ec866d1 Mon Sep 17 00:00:00 2001 From: Wenqi Li <831580+wyli@users.noreply.github.com> Date: Mon, 7 Aug 2023 09:33:50 +0100 Subject: [PATCH 4/4] unblock test_perceptual_loss.py, fixes #6824 Signed-off-by: Wenqi Li <831580+wyli@users.noreply.github.com> Signed-off-by: Wenqi Li <831580+wyli@users.noreply.github.com> --- tests/test_perceptual_loss.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_perceptual_loss.py b/tests/test_perceptual_loss.py index 2f807d8222..ba613c3a4c 100644 --- a/tests/test_perceptual_loss.py +++ b/tests/test_perceptual_loss.py @@ -18,7 +18,7 @@ from monai.losses import PerceptualLoss from monai.utils import optional_import -from tests.utils import SkipIfBeforePyTorchVersion +from tests.utils import SkipIfBeforePyTorchVersion, skip_if_downloading_fails _, has_torchvision = optional_import("torchvision") TEST_CASES = [ @@ -59,13 +59,15 @@ def test_shape(self, input_param, input_shape, target_shape): @parameterized.expand(TEST_CASES) def test_identical_input(self, input_param, input_shape, target_shape): - loss = PerceptualLoss(**input_param) + with skip_if_downloading_fails(): + loss = PerceptualLoss(**input_param) tensor = torch.randn(input_shape) result = loss(tensor, tensor) self.assertEqual(result, torch.Tensor([0.0])) def test_different_shape(self): - loss = PerceptualLoss(spatial_dims=2, network_type="squeeze") + with skip_if_downloading_fails(): + loss = PerceptualLoss(spatial_dims=2, network_type="squeeze") tensor = torch.randn(2, 1, 64, 64) target = torch.randn(2, 1, 32, 32) with self.assertRaises(ValueError):