Repository: Project-MONAI/MONAI

Issue:
PerceptualLoss rate limit exceeded
**Describe the bug**
```
[2023-08-05T01:07:49.325Z] ======================================================================
[2023-08-05T01:07:49.325Z] ERROR: test_identical_input_2 (tests.test_perceptual_loss.TestPerceptualLoss)
[2023-08-05T01:07:49.325Z] ----------------------------------------------------------------------
[2023-08-05T01:07:49.325Z] Traceback (most recent call last):
[2023-08-05T01:07:49.325Z]   File "/usr/local/lib/python3.8/dist-packages/parameterized/parameterized.py", line 620, in standalone_func
[2023-08-05T01:07:49.325Z]     return func(*(a + p.args), **p.kwargs, **kw)
[2023-08-05T01:07:49.325Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/tests/test_perceptual_loss.py", line 62, in test_identical_input
[2023-08-05T01:07:49.325Z]     loss = PerceptualLoss(**input_param)
[2023-08-05T01:07:49.325Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/losses/perceptual.py", line 107, in __init__
[2023-08-05T01:07:49.326Z]     self.perceptual_function = RadImageNetPerceptualSimilarity(net=network_type, verbose=False)
[2023-08-05T01:07:49.326Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/losses/perceptual.py", line 257, in __init__
[2023-08-05T01:07:49.326Z]     self.model = torch.hub.load("Warvito/radimagenet-models", model=net, verbose=verbose)
[2023-08-05T01:07:49.326Z]   File "/usr/local/lib/python3.8/dist-packages/torch/hub.py", line 539, in load
[2023-08-05T01:07:49.326Z]     repo_or_dir = _get_cache_or_reload(repo_or_dir, force_reload, trust_repo, "load",
[2023-08-05T01:07:49.326Z]   File "/usr/local/lib/python3.8/dist-packages/torch/hub.py", line 203, in _get_cache_or_reload
[2023-08-05T01:07:49.326Z]     _validate_not_a_forked_repo(repo_owner, repo_name, ref)
[2023-08-05T01:07:49.326Z]   File "/usr/local/lib/python3.8/dist-packages/torch/hub.py", line 162, in _validate_not_a_forked_repo
[2023-08-05T01:07:49.326Z]     response = json.loads(_read_url(Request(url, headers=headers)))
[2023-08-05T01:07:49.326Z]   File "/usr/local/lib/python3.8/dist-packages/torch/hub.py", line 145, in _read_url
[2023-08-05T01:07:49.326Z]     with urlopen(url) as r:
[2023-08-05T01:07:49.326Z]   File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
[2023-08-05T01:07:49.326Z]     return opener.open(url, data, timeout)
[2023-08-05T01:07:49.326Z]   File "/usr/lib/python3.8/urllib/request.py", line 531, in open
[2023-08-05T01:07:49.326Z]     response = meth(req, response)
[2023-08-05T01:07:49.326Z]   File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
[2023-08-05T01:07:49.326Z]     response = self.parent.error(
[2023-08-05T01:07:49.326Z]   File "/usr/lib/python3.8/urllib/request.py", line 569, in error
[2023-08-05T01:07:49.326Z]     return self._call_chain(*args)
[2023-08-05T01:07:49.326Z]   File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
[2023-08-05T01:07:49.326Z]     result = func(*args)
[2023-08-05T01:07:49.326Z]   File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
[2023-08-05T01:07:49.326Z]     raise HTTPError(req.full_url, code, msg, hdrs, fp)
[2023-08-05T01:07:49.326Z] urllib.error.HTTPError: HTTP Error 403: rate limit exceeded
[2023-08-05T01:07:49.326Z] 
```


Discussion:

Resolving patch:
diff --git a/monai/config/deviceconfig.py b/monai/config/deviceconfig.py
--- 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
 
diff --git a/monai/handlers/clearml_handlers.py b/monai/handlers/clearml_handlers.py
--- 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'.


Test patch:
diff --git a/tests/test_perceptual_loss.py b/tests/test_perceptual_loss.py
--- 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):