"No module named 'fastai.conv_learner'"

I’m getting this error on Google Collab. First I run this command to install the Fast AI library:

!pip install git+https://github.com/fastai/fastai.git

Then I run this command to import conv_learner:

from fastai.conv_learner import*

But I keep getting the error “No module named ‘fastai.conv_learner’”. Does anyone know why this could be?

And does anyone know how to download the data for the satellite images for lesson 3?

3 Likes

I have the same problem after I updated fastai. The directory structure has changed, The conv_learner has moved from the directory fastai/fastai to fastai/old/fastai. You may need t change the symlinks.

You can try by adding fastai to sys.path
or
by creating simulink to fastai folder in your work directory.

I strongly recommend beginners don’t use the pip fastai - use the git clone plus symlink method shown in the course. We ensure that stays compatible with the course material, whilst the pip module will be continually updated.

5 Likes

Hi Jeremy,

I tried with !ln -s /path/to/fastai/fastai in colab, still i am getting No module named ‘fastai.conv_learner’.

Anything more i need to do, please help me.

Link to my notebook.

Thanks and Regards,
Subho

1 Like