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

torch.hub.load error #89

Closed
SeungminMun opened this issue May 14, 2024 · 4 comments
Closed

torch.hub.load error #89

SeungminMun opened this issue May 14, 2024 · 4 comments

Comments

@SeungminMun
Copy link

Thank you for sharing excellent code and model.
I tried torch.hub.load without cloning this repository, and faced the error below.

Traceback (most recent call last):
File "/home/XXX.py", line 336, in
model = torch.hub.load('yvanyin/metric3d', 'metric3d_vit_giant2', pretrain=True).cuda().eval()
File "/opt/conda/lib/python3.10/site-packages/torch/hub.py", line 568, in load
model = _load_local(repo_or_dir, model, *args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/hub.py", line 597, in _load_local
model = entry(*args, **kwargs)
File "/home/XXX/.cache/torch/hub/yvanyin_metric3d_main/hubconf.py", line 110, in metric3d_vit_giant2
cfg = Config.fromfile(cfg_file)
File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 460, in fromfile
lazy_import is None and not Config._is_lazy_import(filename):
File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 1661, in _is_lazy_import
with open(filename, encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'mono/configs/HourglassDecoder/vit.raft5.giant2.py'

Could you check?

@ZachL1
Copy link
Collaborator

ZachL1 commented May 15, 2024

It looks like your cache is incomplete, please delete your incomplete cache located at /home/XXX/.cache/torch/hub/yvanyin_metric3d_main. Then try torch.hub.load again.

Note: Please pay attention to network issues and make sure that torch.hub.load has smooth access to github.com to download the code and huggingface.co to download the weights.

@ZachL1 ZachL1 closed this as completed May 15, 2024
@Gabriellgpc
Copy link

Great job on this model and code!

I'm having that same issue.

"FileNotFoundError: [Errno 2] No such file or directory: 'mono/configs/HourglassDecoder/vit.raft5.small.py'"

I've already check the cache, clean and running again, but didn't work.

could you help me with that as well, please?

@Gabriellgpc
Copy link

found the issue, I've created a PR for it.
#92

i have add small code to convert from relative path to absolute path to get the config file.

@ZachL1
Copy link
Collaborator

ZachL1 commented May 15, 2024

Sorry for my oversight, I just tested and fixed this issue.

@Gabriellgpc Thank you for your kind pr.

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

No branches or pull requests

3 participants