Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
Merged
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
7 changes: 5 additions & 2 deletions generative/losses/perceptual.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ def __init__(
if spatial_dims not in [2, 3]:
raise NotImplementedError("Perceptual loss is implemented only in 2D and 3D.")

if spatial_dims == 2 and "medicalnet_" in network_type:
raise ValueError("MedicalNet networks are only compatible with ``spatial_dims=3``.")
if (spatial_dims == 2 or is_fake_3d) and "medicalnet_" in network_type:
raise ValueError(
"MedicalNet networks are only compatible with ``spatial_dims=3``."
"Argument is_fake_3d must be set to False."
)

self.spatial_dims = spatial_dims
if spatial_dims == 3 and is_fake_3d is False:
Expand Down