inferno-pytorch / inferno

A utility library around PyTorch
Other
244 stars 41 forks source link

ImportError from torchvision #173

Closed sdamrich closed 5 years ago

sdamrich commented 5 years ago

Description

When importing inferno, I got the error:

  File "<stdin>", line 1, in <module>
  File "/home/sdamrich/anaconda3/envs/condaenv/inferno/__init__.py", line 6, in <module>
    from . import io
  File "/home/sdamrich/anaconda3/envs/condaenv/inferno/io/__init__.py", line 1, in <module>
    from . import box
  File "/home/sdamrich/anaconda3/envs/condaenv/inferno/io/box/__init__.py", line 3, in <module>
    from .camvid import CamVid, get_camvid_loaders
  File "/home/sdamrich/anaconda3/envs/condaenv/inferno/io/box/camvid.py", line 9, in <module>
    from torchvision.datasets.folder import is_image_file, default_loader
ImportError: cannot import name 'is_image_file'

I use torchvision 0.2.1 and pytorch 1.0.1

What I Did

Commenting out the first two lines in

/home/sdamrich/anaconda3/envs/condaenv/inferno/io/box/__init__.py 

solved the issue for me.

constantinpape commented 5 years ago

This is fixed on master already, see here. Unfortunately the conda-forge version is not up-to date due to some build issues. I hope to fix this soon.