Depth-Anything icon indicating copy to clipboard operation
Depth-Anything copied to clipboard

`RuntimeError: Error(s) in loading state_dict for ZoeDepth` when running `metric_depth/evaluate.py`

Open zhangzw12319 opened this issue 1 year ago • 1 comments

THX for your great work. There is a issue when running python metric_depth/evaluate.py -m zoedepth --pretrained_resouce "local::../checkpoints_metric_depth/depth_anything_metric_depth_outdoor.pt" -d kitti. Since the server is not conneted to the Internet, I've downloaded Using pretrained resource url::https://github.com/isl-org/ZoeDepth/releases/download/v1.0/ZoeD_M12_N.pt file and put it in the /root/.cache/torch/hub/checkpoints. However, errors are reported:

Missing key(s) in state_dict: "core.core.pretrained.cls_token", "core.core.pretrained.pos_embed", "core.core.pretrained.mask_token", "core.core.pretrained.patch_embed.proj.weight", "core.core.pretrained.patch_embed.proj.bias", "core.core.pretrained.blocks.0.norm1.weight", "core.core.pretrained.blocks.0.norm1.bias",...

Unexpected key(s) in state_dict: "core.core.scratch.layer1_rn.weight", "core.core.scratch.layer2_rn.weight", "core.core.scratch.layer3_rn.weight", "core.core.scratch.layer4_rn.weight", "core.core.scratch.refinenet1.out_conv.weight", "core.core.scratch.refinenet1.out_conv.bias", "core.core.scratch.refinenet1.resConfUnit1.conv1.weight", "core.core.scratch.refinenet1.resConfUnit1.conv1.bias", "core.core.scratch.refinenet1.resConfUnit1.conv2.weight", "core.core.scratch.refinenet1.resConfUnit1.conv2.bias", "core.core.scratch.refinenet1.resConfUnit2.conv1.weight",..."

I wonder is there any mismatch of downloaded weight and the finetuned model. Hope for your kind suggestions!

zhangzw12319 avatar Jan 24 '24 14:01 zhangzw12319

Hi, you should download our pre-trained weights, rather than the original ZoeDepth weights: https://github.com/LiheYoung/Depth-Anything/tree/main/metric_depth#pre-trained-models.

LiheYoung avatar Jan 25 '24 05:01 LiheYoung

pip install timm==0.6.7

songchangshun avatar Aug 08 '24 13:08 songchangshun