Skip to content

Commit b02053b

Browse files
author
Virginia Fernandez
committed
Merge branch '8627-perceptual-loss-errors-out-after-hitting-the-maximum-number-of-downloads' of github.com:virginiafdez/MONAI into 8627-perceptual-loss-errors-out-after-hitting-the-maximum-number-of-downloads
2 parents e3be8de + e2b982e commit b02053b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

monai/losses/perceptual.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
class PercetualNetworkType(StrEnum):
36-
"""Types of neural networks that are supported by perceptua loss."""
36+
"""Types of neural networks that are supported by perceptual loss."""
3737

3838
alex = "alex"
3939
vgg = "vgg"
@@ -131,7 +131,7 @@ def __init__(
131131
net=network_type, verbose=False, channel_wise=channel_wise, cache_dir=cache_dir
132132
)
133133
elif "radimagenet_" in network_type:
134-
self.perceptual_function = RadImageNetPerceptualSimilarity(net=network_type, verbose=False)
134+
self.perceptual_function = RadImageNetPerceptualSimilarity(net=network_type, verbose=False, cache_dir=cache_dir)
135135
elif network_type == "resnet50":
136136
self.perceptual_function = TorchvisionModelPerceptualSimilarity(
137137
net=network_type,
@@ -226,7 +226,7 @@ class MedicalNetPerceptualSimilarity(nn.Module):
226226

227227
def __init__(
228228
self,
229-
net: str = "medicalnet_resnet_10_23datasets",
229+
net: str = "medicalnet_resnet10_23datasets",
230230
verbose: bool = False,
231231
channel_wise: bool = False,
232232
cache_dir: str | None = None,
@@ -333,7 +333,7 @@ def __init__(self, net: str = "radimagenet_resnet50", verbose: bool = False, cac
333333
raise ValueError(
334334
f"Invalid download model name '{net}'. Must be one of: {', '.join(HF_MONAI_MODELS)}."
335335
)
336-
self.model = torch.hub.load("Project-MONAI/perceptual-models", model=net, verbose=verbose, cache_dir=cache_dir,
336+
self.model = torch.hub.load("Project-MONAI/perceptual-models:main", model=net, verbose=verbose, cache_dir=cache_dir,
337337
trust_repo=True)
338338
self.eval()
339339

0 commit comments

Comments
 (0)