MiDaS icon indicating copy to clipboard operation
MiDaS copied to clipboard

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

Open Dez1gner opened this issue 11 months ago • 3 comments

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

Dez1gner avatar Sep 09 '23 03:09 Dez1gner

pip install timm==0.6.13

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

jiaq-li avatar Sep 09 '23 07:09 jiaq-li

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

Estanislao-Oviedo avatar Dec 09 '23 08:12 Estanislao-Oviedo

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?

RGonzLin avatar Feb 10 '24 23:02 RGonzLin