Google Colab-AttributeError: module 'torch' has no attribute 'float32'

(Mallikarjun Bendigeri) #1

In google colab,I installed fastai==0.7.0 and I see the below error when I import the fastai libraries

!pip install fastai==0.7.0

from fastai.imports import *
from fastai.models import *
from fastai.sgdr import *
from fastai.plots import *
from fastai.conv_learner import *
from fastai.transforms import *
from fastai.torch_imports import *
from fastai.dataset import *

Error

AttributeError: module ‘torch’ has no attribute ‘float32’

0 Likes

#2

Me, too.

0 Likes

Fastai v0.7 install issues thread
#3

torchtext is the offending …?module?..(not sure what to call it) that causes this error. The authors released torchtext 0.3.1 earlier today (2018-10-11). Installing the previous version restores full functionality:
!{sys.executable} -m pip install torchtext==0.2.3

14 Likes

Error while importing fast.ai modules
ImportError: cannot import name 'as_tensor'?
#4

Bingo! I spend hours trying to get this work. Thank you so much @eunosM3.

0 Likes

#5

no problem. glad it helped

0 Likes

(Jeremy Howard (Admin)) #6

I’ve added that to the environment now btw.

3 Likes

#7

@jeremy Terrific. Thanks for your attention to this matter.

1 Like