Skip to content

Commit

Permalink
Fix typo in identifier of PerceptualNetworkType
Browse files Browse the repository at this point in the history
    Previously it was 'medical_resnet50_23datasets', which doesn't correspond to the name in the hubconf.py of Warvito's repo. So either on got the error:
    ```
    ValueError: Unrecognised criterion entered for Adversarial Loss. Must be one in: alex, vgg, squeeze, radimagenet_resnet50, medicalnet_resnet10_23datasets, medical_resnet50_23datasets, resnet50
    ```
    or
    ```
    RuntimeError: Cannot find callable medical_resnet50_23datasets in hubconf
    ```

    Fix the identifier's and string's typo from medical_* to medicalnet_* to conform to Warvito's hubconf.py in the MedicalNet repo.
    Add test case for `network_type=medicalnet_resnet50_23datasets`

Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>

Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
  • Loading branch information
SomeUserName1 committed Mar 14, 2024
1 parent 95f69de commit 1d91a3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion monai/losses/perceptual.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PercetualNetworkType(StrEnum):
squeeze = "squeeze"
radimagenet_resnet50 = "radimagenet_resnet50"
medicalnet_resnet10_23datasets = "medicalnet_resnet10_23datasets"
medical_resnet50_23datasets = "medical_resnet50_23datasets"
medicalnet_resnet50_23datasets = "medicalnet_resnet50_23datasets"
resnet50 = "resnet50"


Expand Down
5 changes: 5 additions & 0 deletions tests/test_perceptual_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
(2, 1, 64, 64, 64),
(2, 1, 64, 64, 64),
],
[
{"spatial_dims": 3, "network_type": "medicalnet_resnet50_23datasets", "is_fake_3d": False},
(2, 1, 64, 64, 64),
(2, 1, 64, 64, 64),
],
[
{"spatial_dims": 3, "network_type": "resnet50", "is_fake_3d": True, "pretrained": True, "fake_3d_ratio": 0.2},
(2, 1, 64, 64, 64),
Expand Down

0 comments on commit 1d91a3d

Please sign in to comment.