huggingface / controlnet_aux

Apache License 2.0
398 stars 86 forks source link

importerror torchvision.transforms import transforms #79

Closed jontoto closed 1 year ago

jontoto commented 1 year ago

Im trying to install this and getting the following error when importing:

from controlnet_aux import LineartAnimeDetector
  File "/usr/local/lib/python3.10/dist-packages/controlnet_aux/__init__.py", line 4, in <module>
    from .leres import LeresDetector
  File "/usr/local/lib/python3.10/dist-packages/controlnet_aux/leres/__init__.py", line 10, in <module>
    from .leres.depthmap import estimateboost, estimateleres
  File "/usr/local/lib/python3.10/dist-packages/controlnet_aux/leres/leres/depthmap.py", line 11, in <module>
    from torchvision.transforms import transforms
ImportError: cannot import name 'transforms' from 'torchvision.transforms' (/usr/local/lib/python3.10/dist-packages/torchvision/transforms.py)

I have torchvision==0.1.6 installed and running

python -c "from torchvision.transforms import Compose"

returns without error.

Does this require a specific version of torchvision?

jontoto commented 1 year ago

In case anyone else runs into this: torchvision 0.15.2 works