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.52k stars 625 forks source link

AttributeError: 'Block' object has no attribute 'drop_path' #241

Open Dez1gner opened 1 year ago

Dez1gner commented 1 year ago

I get this error when using the model dpt_beit_large_512.pt I use Ubuntu 22.04, Automatic1111 Here is the full report from the console: https://pastebin.com/tF34UqDr

lijia7 commented 1 year ago

pip install timm==0.6.13

https://github.com/isl-org/MiDaS/issues/235#issuecomment-1683707861

Estanislao-Oviedo commented 11 months ago

I'm still getting the same problem even after doing that

RGonzLin commented 9 months ago

I also get an error even when doing pip install timm==0.6.13, in MiDaS/midas/backbones/beit.py --> _get_rel_pos_bias(self, window_size) --> new_sub_table = F.interpolate(old_sub_table, size=(new_height, new_width), mode="bilinear”).

I changed every drop_path reference in beit.py to drop_path1. This solved every problem I had while running timm 0.9.7 (and torch 2.1.0+cu121). I implemented the changes in this fork: https://github.com/RGonzLin/MiDaS.

This does not work with timm 0.6.13 though, I guess I shouldn't do a pull request?