Fastai pytorch import error

I used the describied pip install torch torchvision and then pip install fastai within a virtual environment but then when i do a

from fastai.vision import * i get the following

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
 in 
----> 1 from fastai.vision import *
      2 from fastai.metrics import error_rate
      3 

~/Documents/DecorMatters/dm_bg_removal/venv/lib/python3.6/site-packages/fastai/vision/__init__.py in 
      3 from .learner import *
      4 from .image import *
----> 5 from .data import *
      6 from .transform import *
      7 from .tta import *

~/Documents/DecorMatters/dm_bg_removal/venv/lib/python3.6/site-packages/fastai/vision/data.py in 
      2 from ..torch_core import *
      3 from .image import *
----> 4 from .transform import *
      5 from ..data_block import *
      6 from ..basic_data import *

~/Documents/DecorMatters/dm_bg_removal/venv/lib/python3.6/site-packages/fastai/vision/transform.py in 
    231 
    232 # XXX: replace this with direct usage of `solve` once fastai requires pytorch 1.1+
--> 233 _solve_func = getattr(torch, 'solve', torch.gesv)
    234 
    235 def _find_coeffs(orig_pts:Points, targ_pts:Points)->Tensor:

AttributeError: module 'torch' has no attribute 'gesv'

when i check out the versions of my libraries i get

import torch; print(torch.__version__)
1.2.0
import fastai; fastai.__version__
1.0.55

This was all working great before on my mac :frowning: If anyone has any suggestions …

2 Likes

You’ll need v1.0.56 to fix this bug, or downgrade pytorch to 1.1.0

4 Likes

Can you please update PyPi with 1.0.56 ?
pip install is broken because it install pytorch 1.2.0, but fastai 1.0.55

1 Like

Can you please update on conda also? It’s also with pytorch 1.2.0, but fastai 1.0.55…

The release process didn’t fully go through and I hadn’t caught it. 1.0.57 should be in pip and conda now.

3 Likes

Thanks for the quick one!

It works! Thanks!

Thanks!

It might be best to specify stronger restrictions on the torch version in setup.py so that existing pieces of code that run on certain versions of fastai don’t suddenly break. Unless, of course, there is a reason for not wanting to lock it down.

I had the same issue with fastai v1.0.54 and pytorch v1.2.0. Updating fastai to v1.0.57 solved my problem.

Would it be possible to upgrade fastai to v1.0.56 for Linux POWER (linux-ppc64le) for the same issue and have pytorch 1.2.0.

Furthermore, my institution has access (advised strictly) to packages supported by the IBM Watson Machine Learning Community Edition v1.6.2, I noticed that fastai isn’t supported. Can you please advise?