acezero
acezero copied to clipboard
error while loading model
hi, could you please help to work out this I ran this code without any modification
python ace_zero.py "/data/xuyang/datasets/public/360_v2/garden/images/*.jpg" result_folder
It shows
INFO:__main__:Starting reconstruction of files matching /data/xuyang/datasets/public/360_v2/garden/images/*.jpg.
INFO:__main__:Downloading ZoeDepth model from the main process.
Using cache found in /root/.cache/torch/hub/intel-isl_MiDaS_master
Using cache found in /root/.cache/torch/hub/isl-org_ZoeDepth_main
img_size [384, 512]
Using cache found in /root/.cache/torch/hub/intel-isl_MiDaS_master
Params passed to Resize transform:
width: 512
height: 384
resize_target: True
keep_aspect_ratio: True
ensure_multiple_of: 32
resize_method: minimal
/opt/conda/envs/seganygaussians/lib/python3.10/site-packages/torch/nn/modules/transformer.py:306: UserWarning: enable_nested_tensor is True, but self.use_nested_tensor is False because encoder_layer.self_attn.batch_first was not True(use batch_first for better inference performance)
warnings.warn(f"enable_nested_tensor is True, but self.use_nested_tensor is False because {why_not_sparsity_fast_path}")
Using pretrained resource url::https://github.com/isl-org/ZoeDepth/releases/download/v1.0/ZoeD_M12_NK.pt
Traceback (most recent call last):
File "/data/xuyang/acezero/ace_zero.py", line 163, in <module>
model = dataset_io.get_depth_model()
File "/data/xuyang/acezero/dataset_io.py", line 208, in get_depth_model
model_zoe_nk = torch.hub.load(repo, "ZoeD_NK", pretrained=True, force_reload=init, trust_repo="check")
File "/opt/conda/envs/seganygaussians/lib/python3.10/site-packages/torch/hub.py", line 568, in load
model = _load_local(repo_or_dir, model, *args, **kwargs)
File "/opt/conda/envs/seganygaussians/lib/python3.10/site-packages/torch/hub.py", line 597, in _load_local
model = entry(*args, **kwargs)
File "/root/.cache/torch/hub/isl-org_ZoeDepth_main/hubconf.py", line 153, in ZoeD_NK
model = build_model(config)
File "/root/.cache/torch/hub/isl-org_ZoeDepth_main/zoedepth/models/builder.py", line 51, in build_model
return get_version(config.version_name).build_from_config(config)
File "/root/.cache/torch/hub/isl-org_ZoeDepth_main/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py", line 333, in build_from_config
return ZoeDepthNK.build(**config)
File "/root/.cache/torch/hub/isl-org_ZoeDepth_main/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py", line 328, in build
model = load_state_from_resource(model, pretrained_resource)
File "/root/.cache/torch/hub/isl-org_ZoeDepth_main/zoedepth/models/model_io.py", line 84, in load_state_from_resource
return load_state_dict_from_url(model, url, progress=True)
File "/root/.cache/torch/hub/isl-org_ZoeDepth_main/zoedepth/models/model_io.py", line 61, in load_state_dict_from_url
return load_state_dict(model, state_dict)
File "/root/.cache/torch/hub/isl-org_ZoeDepth_main/zoedepth/models/model_io.py", line 49, in load_state_dict
model.load_state_dict(state)
File "/opt/conda/envs/seganygaussians/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2189, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for ZoeDepthNK:
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".
Hi! Please confirm that you are using our environment file. This issue might be related: https://github.com/isl-org/ZoeDepth/issues/72
Best, Eric
Closing due to inactivity. Feel free to re-open.