ModuleNotFoundError: No module named 'fastai.transforms'


#1

I ran the lesson on my local but got this error.


ModuleNotFoundError Traceback (most recent call last)
in ()
----> 1 from fastai.transforms import *
2 from fastai.conv_learner import *
3 from fastai.model import *
4 from fastai.dataset import *
5 from fastai.sgdr import *

ModuleNotFoundError: No module named ‘fastai.transforms’

I already installed fastai.


(Shubham) #2

I randomly get error when any fastai module is importing torch.as_tensor. No module named torch.as_tensor.
I am using google colab. I don’t understand why.


#3

Is the lesson1.ipynb out-of-date?
I pulled the latest fastai and cannot find fastai.transforms. fastai.conv_learner…
only can import fastai.imports

Why?


#4

The line which imports “fastai.transforms” is trying to import the contents in the directory old/fastai. If you are on Windows, the symbolic link might be broken and you have to manually create a sym link using command prompt.


(Matthew Elgazar) #5

I am having the same issue. I have have both torch and fastai installed. I tried installing with both conda and pip. Issue still remains.


(Kostas Ha) #6

Hi, I had the same problem. Windows is in a kind experimental mode at the moment. Please follow the instruction from this post, Howto: installation on Windows


(Arie Pratama Sutiono) #7

Hey, I think using
!pip install torchvision fastai==0.6

will solve the problem. Not sure why fastai==0.7 didn’t work for me.

Cheers


(Francisco Soares) #8

fastai==0.7 worked fine for me. I just had to also downgrade torchtext to version 0.2.3


#9

I have the same issue.
I am using version 1.0
I guess maybe fastai.transform no longer exist in latest version.
(I tried to make link, does not work)