Fastai pytorch import error

#1

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 …

1 Like

#2

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

3 Likes

(Saptarshi Purkayastha) #3

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

(Ana Rocha) #4

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

0 Likes

#5

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

(Saptarshi Purkayastha) #6

Thanks for the quick one!

0 Likes

(Ana Rocha) #7

It works! Thanks!

0 Likes

#8

Thanks!

0 Likes

(Patrick Orlando) #9

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.

0 Likes