Getting RuntimeError: Error(s) in loading state_dict for ZoeDepth:
/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".
Getting the same error.
Getting the same error.
Getting the same error.
@thias15
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 pip install timm==0.6.7
run pip install timm==0.6.7
This solved it! Thank you
h
run pip install timm==0.6.7
have installed but still getting this zoedepth error, anyone else with a solution? :(
h
run pip install timm==0.6.7
have installed but still getting this zoedepth error, anyone else with a solution? :(
me too
run pip install timm==0.6.7
Thank you very much, I have solved the issue with your solution.