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

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 *


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

Me, too.

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


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

no problem. glad it helped

I’ve added that to the environment now btw.


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

1 Like