isl-org / MiDaS

Code for robust monocular depth estimation described in "Ranftl et. al., Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer, TPAMI 2022"
MIT License
4.25k stars 597 forks source link

Error loading model with timm==0.9.7 #245

Open lzqsd opened 9 months ago

lzqsd commented 9 months ago

Hi there,

I tried to load the pretrained model but met an error "Unexpected key(s) in state_dict: "pretrained.model.blocks.0.attn.relative_position_index", ....". I found that this error only happened with timm=0.9.7 and would be gone with timm==0.6.7. I wonder if there is any plan to support the newest timm. Thanks!

lzqsd commented 8 months ago

I can load the model again by removing all item in weight containing "relative_position_index".