fast.ia ModuleNotFoundError in Google Colab



This site utilizes Google Analytics, Google AdSense, as well as participates in affiliate partnerships with various companies including Amazon. Please view the privacy policy for more details.

Just for fun, I started taking a free online course called Practical Deep Learning for Coders. Part of the course involves running things via a Jupyter Notebook, so I’ve been using Google Colab product to run the sample code.

After all, it requires GPUs and Linux, and I’m running Windows with no GPU.

Right off the bat, however, I ran into an error when trying to run the example code - “ModuleNotFoundError: No module named ‘fastai.callback.all’; ‘fastai.callback’ is not a package”.

Here’s the full text of the error:

     |████████████████████████████████| 727kB 5.9MB/s
     |████████████████████████████████| 51kB 5.0MB/s
     |████████████████████████████████| 194kB 40.3MB/s
     |████████████████████████████████| 1.1MB 42.5MB/s
     |████████████████████████████████| 51kB 3.9MB/s
     |████████████████████████████████| 51kB 4.5MB/s
     |████████████████████████████████| 92kB 5.8MB/s
     |████████████████████████████████| 40kB 3.8MB/s
     |████████████████████████████████| 51kB 4.6MB/s
     |████████████████████████████████| 61kB 5.0MB/s
     |████████████████████████████████| 2.6MB 37.5MB/s
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-2b820b2b946f> in <module>()
      1 #hide
      2 get_ipython().system('pip install -Uqq fastbook')
----> 3 import fastbook
      4 fastbook.setup_book()

1 frames
/usr/local/lib/python3.6/dist-packages/fastai/vision/all.py in <module>()
      1 from . import models
      2 from ..basics import *
----> 3 from ..callback.all import *
      4 from .augment import *
      5 from .core import *

ModuleNotFoundError: No module named 'fastai.callback.all'; 'fastai.callback' is not a package

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

And here’s a screenshot of the error:

Screenshot of the error.

It turns out I only needed to copy the Jupyter Notebook to my own Google Drive, which I easily did by clicking on the Copy to Drive button at the top of the notebook:

Copy to Drive button.

I had to approve access to my Google Drive (even though they’re both Google products) which, for whatever reason, involved copy-and-pasting an access code.

The reason I needed to copy the Jupyter Notebook to my Google Drive is that the modules it was importing get imported to my Drive - and, I suppose, counts towards my Google Drive quota.

Leave a Reply

Note that comments won't appear until approved.