Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perceptual loss with medicalnet_resnet50_23datasets errors due to a typo. #7547

Closed
SomeUserName1 opened this issue Mar 14, 2024 · 0 comments · Fixed by #7548
Closed

Perceptual loss with medicalnet_resnet50_23datasets errors due to a typo. #7547

SomeUserName1 opened this issue Mar 14, 2024 · 0 comments · Fixed by #7548

Comments

@SomeUserName1
Copy link
Contributor

SomeUserName1 commented Mar 14, 2024

Describe the bug
When trying to use network_type=medicalnet_resnet50_23datasets, I got the following error:

ValueError: Unrecognised criterion entered for Adversarial Loss. Must be one in: alex, vgg, squeeze, radimagenet_resnet50, medicalnet_resnet10_23datasets, medical_resnet50_23datasets, resnet50

Using medical_resnet50_23datasets raises

RuntimeError: Cannot find callable medical_resnet50_23datasets in hubconf

The documentation mentions medicalnet_resnet50_23datasets correctly (as in warvito's hubconf.py in the MedicalNet repo, however in the PerceptualNetworkType Enum, the "net" is missing in the identifier and the string as seen in the error ('medical_resnet50_23datasets') message which is generated from the enum.

To Reproduce
Use the PerceptualLoss class with network_type=medicalnet_resnet50_23datasets or network_type=medical_resnet50_23datasets.

Expected behavior
The class/methods download the specified model from the given repos and calculate the loss accordingly.

Screenshots

Environment

Ensuring you use the relevant python executable, please paste the output of:

python -c "import monai; monai.config.print_debug_info()"
MONAI config

================================
Printing MONAI config...

MONAI version: 1.3.0+88.g95f69dea
Numpy version: 1.26.4
Pytorch version: 2.2.1+cu121
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 95f69de
MONAI file: /home//workspace/MONAI/monai/init.py

Optional dependencies:
Pytorch Ignite version: 0.4.11
ITK version: 5.3.0
Nibabel version: 5.2.1
scikit-image version: 0.22.0
scipy version: 1.12.0
Pillow version: 10.2.0
Tensorboard version: 2.16.2
gdown version: 4.7.3
TorchVision version: 0.17.1+cu121
tqdm version: 4.66.2
lmdb version: 1.4.1
psutil version: 5.9.8
pandas version: 2.2.1
einops version: 0.7.0
transformers version: 4.38.2
mlflow version: 2.11.1
pynrrd version: 1.0.0
clearml version: 1.14.5rc0

For details about installing the optional dependencies, please visit:
https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies

================================
Printing system config...

System: Linux
Linux version: Arch Linux
Platform: Linux-6.7.4-zen1-1-zen-x86_64-with-glibc2.39
Processor:
Machine: x86_64
Python version: 3.11.7
Process name: python
Command: ['python', '-c', 'import monai; monai.config.print_debug_info()']
Open files: []
Num physical CPUs: 24
Num logical CPUs: 32
Num usable CPUs: 32
CPU usage (%): [9.1, 3.9, 8.2, 9.6, 6.9, 3.0, 4.7, 5.7, 92.3, 7.9, 97.0, 3.0, 4.7, 15.1, 6.8, 4.9, 4.7, 4.9, 4.4, 4.6, 3.6, 4.1, 3.6, 3.3, 3.6, 3.6, 3.3, 3.8, 3.3, 3.3, 3.3, 3.3]
CPU freq. (MHz): 1174
Load avg. in last 1, 5, 15 mins (%): [24.7, 25.0, 24.2]
Disk usage (%): 45.2
Avg. sensor temp. (Celsius): UNKNOWN for given OS
Total physical memory (GB): 62.6
Available memory (GB): 45.1
Used memory (GB): 16.6

================================
Printing GPU config...

Num GPUs: 1
Has CUDA: True
CUDA version: 12.1
cuDNN enabled: True
NVIDIA_TF32_OVERRIDE: None
TORCH_ALLOW_TF32_CUBLAS_OVERRIDE: None
cuDNN version: 8902
Current device: 0
Library compiled for CUDA architectures: ['sm_50', 'sm_60', 'sm_70', 'sm_75', 'sm_80', 'sm_86', 'sm_90']
GPU 0 Name: NVIDIA GeForce RTX 4090 Laptop GPU
GPU 0 Is integrated: False
GPU 0 Is multi GPU board: False
GPU 0 Multi processor count: 76
GPU 0 Total memory (GB): 15.7
GPU 0 CUDA capability (maj.min): 8.9

Additional context

KumoLiu pushed a commit that referenced this issue Mar 15, 2024
Fixes #7547 

### Description
Previously it was 'medical_resnet50_23datasets' for both identifier and
string, which doesn't correspond to the name in the hubconf.py of
Warvito's repo. Now it is the correct version (according to Warvitos
repo) 'medicalnet_resnet50_23datasets'.

The docs state it correctly already. 

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ x] New tests added to cover the changes.
- [ x] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [x ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
juampatronics pushed a commit to juampatronics/MONAI that referenced this issue Mar 25, 2024
Fixes Project-MONAI#7547

### Description
Previously it was 'medical_resnet50_23datasets' for both identifier and
string, which doesn't correspond to the name in the hubconf.py of
Warvito's repo. Now it is the correct version (according to Warvitos
repo) 'medicalnet_resnet50_23datasets'.

The docs state it correctly already.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ x] New tests added to cover the changes.
- [ x] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [x ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
Signed-off-by: Juan Pablo de la Cruz Gutiérrez <juampatronics@gmail.com>
Yu0610 pushed a commit to Yu0610/MONAI that referenced this issue Apr 11, 2024
Fixes Project-MONAI#7547

### Description
Previously it was 'medical_resnet50_23datasets' for both identifier and
string, which doesn't correspond to the name in the hubconf.py of
Warvito's repo. Now it is the correct version (according to Warvitos
repo) 'medicalnet_resnet50_23datasets'.

The docs state it correctly already.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ x] New tests added to cover the changes.
- [ x] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [x ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
Signed-off-by: Yu0610 <612410030@alum.ccu.edu.tw>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant