-
Notifications
You must be signed in to change notification settings - Fork 193
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
Getting RuntimeError: Error(s) in loading state_dict for ZoeDepth: #97
Comments
Getting the same error. |
2 similar comments
Getting the same error. |
Getting the same error. |
Has anyone encountered this issue? How should I resolve it? I would greatly appreciate it if you could respond. |
So do I and everyting was fine two weeks ago. |
run |
This solved it! Thank you |
h
have installed but still getting this zoedepth error, anyone else with a solution? :( |
me too |
Thank you very much, I have solved the issue with your solution. |
/bin/python3 /home/devashish/Desktop/ZoeDepth/depth.py img_size [384, 512] Using cache found in /home/devashish/.cache/torch/hub/intel-isl_MiDaS_master /home/devashish/.local/lib/python3.10/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3526.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] Params passed to Resize transform: width: 512 height: 384 resize_target: True keep_aspect_ratio: True ensure_multiple_of: 32 resize_method: minimal Using pretrained resource url::https://github.com/isl-org/ZoeDepth/releases/download/v1.0/ZoeD_M12_N.pt Traceback (most recent call last): File "/home/devashish/Desktop/ZoeDepth/depth.py", line 7, in <module> model_zoe_n = torch.hub.load(".", "ZoeD_N", source="local", pretrained=True) File "/home/devashish/.local/lib/python3.10/site-packages/torch/hub.py", line 566, in load model = _load_local(repo_or_dir, model, *args, **kwargs) File "/home/devashish/.local/lib/python3.10/site-packages/torch/hub.py", line 595, in _load_local model = entry(*args, **kwargs) File "/home/devashish/Desktop/ZoeDepth/./hubconf.py", line 69, in ZoeD_N model = build_model(config) File "/home/devashish/Desktop/ZoeDepth/./zoedepth/models/builder.py", line 51, in build_model return get_version(config.version_name).build_from_config(config) File "/home/devashish/Desktop/ZoeDepth/./zoedepth/models/zoedepth/zoedepth_v1.py", line 250, in build_from_config return ZoeDepth.build(**config) File "/home/devashish/Desktop/ZoeDepth/./zoedepth/models/zoedepth/zoedepth_v1.py", line 245, in build model = load_state_from_resource(model, pretrained_resource) File "/home/devashish/Desktop/ZoeDepth/./zoedepth/models/model_io.py", line 84, in load_state_from_resource return load_state_dict_from_url(model, url, progress=True) File "/home/devashish/Desktop/ZoeDepth/./zoedepth/models/model_io.py", line 61, in load_state_dict_from_url return load_state_dict(model, state_dict) File "/home/devashish/Desktop/ZoeDepth/./zoedepth/models/model_io.py", line 49, in load_state_dict model.load_state_dict(state) File "/home/devashish/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for ZoeDepth: Unexpected key(s) in state_dict: "core.core.pretrained.model.blocks.0.attn.relative_position_index", "core.core.pretrained.model.blocks.1.attn.relative_position_index", "core.core.pretrained.model.blocks.2.attn.relative_position_index", "core.core.pretrained.model.blocks.3.attn.relative_position_index", "core.core.pretrained.model.blocks.4.attn.relative_position_index", "core.core.pretrained.model.blocks.5.attn.relative_position_index", "core.core.pretrained.model.blocks.6.attn.relative_position_index", "core.core.pretrained.model.blocks.7.attn.relative_position_index", "core.core.pretrained.model.blocks.8.attn.relative_position_index", "core.core.pretrained.model.blocks.9.attn.relative_position_index", "core.core.pretrained.model.blocks.10.attn.relative_position_index", "core.core.pretrained.model.blocks.11.attn.relative_position_index", "core.core.pretrained.model.blocks.12.attn.relative_position_index", "core.core.pretrained.model.blocks.13.attn.relative_position_index", "core.core.pretrained.model.blocks.14.attn.relative_position_index", "core.core.pretrained.model.blocks.15.attn.relative_position_index", "core.core.pretrained.model.blocks.16.attn.relative_position_index", "core.core.pretrained.model.blocks.17.attn.relative_position_index", "core.core.pretrained.model.blocks.18.attn.relative_position_index", "core.core.pretrained.model.blocks.19.attn.relative_position_index", "core.core.pretrained.model.blocks.20.attn.relative_position_index", "core.core.pretrained.model.blocks.21.attn.relative_position_index", "core.core.pretrained.model.blocks.22.attn.relative_position_index", "core.core.pretrained.model.blocks.23.attn.relative_position_index".
The text was updated successfully, but these errors were encountered: