Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Modification to PerceptualLoss to clarify when you can use 3D network medicalnet #213

@virginiafdez

Description

@virginiafdez

When you select medicalnet (either 10 or 50Resnet), and you use is_fake_3D = True, there is an LPIPS error coming out:

AttributeError: 'LPIPS' object has no attribute 'chns

There should be an error because is_fake_3D should be False if a 3D net is used, but the error doesn't show where the problem is.
I suggest we change the lines 52/53 in init:

if spatial_dims == 2 and "medicalnet_" in network_type: raise ValueError("MedicalNet networks are only compatible with ``spatial_dims=3``.")

to:

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions