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 import * i get the following

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

~/Documents/DecorMatters/dm_bg_removal/venv/lib/python3.6/site-packages/fastai/vision/ 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/ 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/ in 
    232 # XXX: replace this with direct usage of `solve` once fastai requires pytorch 1.1+
--> 233 _solve_func = getattr(torch, 'solve', torch.gesv)
    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__)
import fastai; fastai.__version__

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


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


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.


Thanks for the quick one!

It works! Thanks!


It might be best to specify stronger restrictions on the torch version in 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?