Skip to content
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
1 change: 1 addition & 0 deletions monai/config/deviceconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions monai/handlers/clearml_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down Expand Up @@ -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'.
Expand Down Expand Up @@ -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'.
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ mlflow =
mlflow
matplotlib =
matplotlib
clearml =
clearml
tensorboardX =
tensorboardX
pyyaml =
Expand Down
8 changes: 5 additions & 3 deletions tests/test_perceptual_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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):
Expand Down