Skip to content

FileNotFoundError in test_perceptual_loss #7382

@KumoLiu

Description

@KumoLiu
[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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions