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

FileNotFoundError in test_perceptual_loss #7382

Closed
KumoLiu opened this issue Jan 10, 2024 · 5 comments
Closed

FileNotFoundError in test_perceptual_loss #7382

KumoLiu opened this issue Jan 10, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented Jan 10, 2024

[2024-01-10T02:16:36.089Z] ======================================================================
[2024-01-10T02:16:36.089Z] ERROR: test_identical_input_2 (tests.test_perceptual_loss.TestPerceptualLoss)
[2024-01-10T02:16:36.089Z] ----------------------------------------------------------------------
[2024-01-10T02:16:36.089Z] Traceback (most recent call last):
[2024-01-10T02:16:36.089Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func
[2024-01-10T02:16:36.089Z]     return func(*(a + p.args), **p.kwargs, **kw)
[2024-01-10T02:16:36.089Z]   File "/opt/monai/tests/test_perceptual_loss.py", line 65, in test_identical_input
[2024-01-10T02:16:36.089Z]     loss = PerceptualLoss(**input_param)
[2024-01-10T02:16:36.089Z]   File "/opt/monai/monai/losses/perceptual.py", line 107, in __init__
[2024-01-10T02:16:36.089Z]     self.perceptual_function = RadImageNetPerceptualSimilarity(net=network_type, verbose=False)
[2024-01-10T02:16:36.090Z]   File "/opt/monai/monai/losses/perceptual.py", line 257, in __init__
[2024-01-10T02:16:36.090Z]     self.model = torch.hub.load("Warvito/radimagenet-models", model=net, verbose=verbose)
[2024-01-10T02:16:36.090Z]   File "/usr/local/lib/python3.10/dist-packages/torch/hub.py", line 565, in load
[2024-01-10T02:16:36.090Z]     model = _load_local(repo_or_dir, model, *args, **kwargs)
[2024-01-10T02:16:36.090Z]   File "/usr/local/lib/python3.10/dist-packages/torch/hub.py", line 594, in _load_local
[2024-01-10T02:16:36.090Z]     model = entry(*args, **kwargs)
[2024-01-10T02:16:36.090Z]   File "/root/.cache/torch/hub/Warvito_radimagenet-models_main/radimagenet_models/models/resnet.py", line 153, in radimagenet_resnet50
[2024-01-10T02:16:36.090Z]     model.load_state_dict(torch.load(cached_file))
[2024-01-10T02:16:36.090Z]   File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 988, in load
[2024-01-10T02:16:36.090Z]     with _open_file_like(f, 'rb') as opened_file:
[2024-01-10T02:16:36.090Z]   File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 437, in _open_file_like
[2024-01-10T02:16:36.090Z]     return _open_file(name_or_buffer, mode)
[2024-01-10T02:16:36.090Z]   File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 418, in __init__
[2024-01-10T02:16:36.090Z]     super().__init__(open(name, mode))
[2024-01-10T02:16:36.090Z] FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/torch/hub/checkpoints/RadImageNet-ResNet50_notop.pth'
[2024-01-10T02:16:36.090Z] 
[2024-01-10T02:16:36.090Z] ----------------------------------------------------------------------
[2024-01-10T02:16:36.090Z] Ran 13397 tests in 4093.907s
[2024-01-10T02:16:36.090Z] 
[2024-01-10T02:16:36.090Z] FAILED (errors=1, skipped=158)
@KumoLiu KumoLiu added the bug Something isn't working label Jan 10, 2024
@KumoLiu
Copy link
Contributor Author

KumoLiu commented Jan 10, 2024

Access denied with the following error:

        Cannot retrieve the public link of the file. You may need to change
        the permission to 'Anyone with the link', or have had many accesses. 

The cause of the error appears to be that the permission of the link has changed.

self.model = torch.hub.load("Warvito/radimagenet-models", model=net, verbose=verbose)

Hi @marksgraham and @Warvito, would you mind taking a look at this one? Is there any reason you have done this or has it been done accidentally? Thanks!

@KumoLiu
Copy link
Contributor Author

KumoLiu commented Jan 10, 2024

May not be due to permission but the issue described here.

@marksgraham
Copy link
Contributor

marksgraham commented Jan 10, 2024

I can now download so I think the problem must be hitting a daily download limit. I think we need to move to a non g-drive solution for hosting these files. How is this handled in the rest of MONAI?
@ericspod

@KumoLiu
Copy link
Contributor Author

KumoLiu commented Jan 11, 2024

It may be about a daily download limit.
It has failed for three days and happened in other gdown-related tests.
#7383
Project-MONAI/tutorials#1608 (comment)

We can put some small files here for test.
https://github.com/Project-MONAI/MONAI-extra-test-data/releases

KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Jan 12, 2024
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
ericspod pushed a commit that referenced this issue Jan 12, 2024
Workaround for #7382 #7383

### Description

Based on the comment
[here](wkentaro/gdown#291 (comment)),
pin the gdown version as a workaround. Will review this one once gdown
has some update internal.

### 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).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] 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: YunLiu <55491388+KumoLiu@users.noreply.github.com>
@ericspod
Copy link
Member

This issue is either sorted with the gdown fix or it's a matter of moving temp files to the extra test data repo so I'd close this for now.

marksgraham pushed a commit to marksgraham/MONAI that referenced this issue Jan 30, 2024
Workaround for Project-MONAI#7382 Project-MONAI#7383

### Description

Based on the comment
[here](wkentaro/gdown#291 (comment)),
pin the gdown version as a workaround. Will review this one once gdown
has some update internal.

### 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).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] 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: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Signed-off-by: Mark Graham <markgraham539@gmail.com>
juampatronics pushed a commit to juampatronics/MONAI that referenced this issue Mar 25, 2024
Workaround for Project-MONAI#7382 Project-MONAI#7383

### Description

Based on the comment
[here](wkentaro/gdown#291 (comment)),
pin the gdown version as a workaround. Will review this one once gdown
has some update internal.

### 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).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] 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: YunLiu <55491388+KumoLiu@users.noreply.github.com>
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
Workaround for Project-MONAI#7382 Project-MONAI#7383

### Description

Based on the comment
[here](wkentaro/gdown#291 (comment)),
pin the gdown version as a workaround. Will review this one once gdown
has some update internal.

### 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).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] 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: YunLiu <55491388+KumoLiu@users.noreply.github.com>
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
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants