Fastai: Problems running vision tutorial in colab

Created on 5 Sep 2020  Â·  4Comments  Â·  Source: fastai/fastai

Describe the bug
I have opened the vision tutorial notebook in colab, using the colab button on this page: https://docs.fast.ai/tutorial.vision. When trying to execute the first cell (from fastai.vision.all import *) I get the following error:

ModuleNotFoundError: No module named 'fastai.vision.all'

After some poking around, I tried to remove the ".all" in the above code, and the cell executed successfully. Assuming that was a valid bug workaround, I then tried executing the other cells. On the cell containing dls = ImageDataLoaders.from_name_func(path, files, label_func, item_tfms=Resize(224)), I received the error:

NameError: name 'ImageDataLoaders' is not defined

To Reproduce
See Above

Expected behavior
I expected to execute each cell without errors and with correct output.

Error with full stack trace

Place between these lines with triple backticks:


Additional context
Add any other context about the problem here.

Most helpful comment

Hi @rfernand2 I found a potential solution (from the fast.ai course forums) which is to run !pip install fastai --upgrade, then restart the runtime, upon which the fastai.vision.all import worked for me.

All 4 comments

Hi @rfernand2 I found a potential solution (from the fast.ai course forums) which is to run !pip install fastai --upgrade, then restart the runtime, upon which the fastai.vision.all import worked for me.

Thanks @vishalbakshi - that fixed the 2 problems for me! But it seems there is a tutorial / colab version pairing problem that I hope gets addressed by this issue.

I've added a pip upgrade cell to the top of every notebook now, which should resolve this.

Was this page helpful?
0 / 5 - 0 ratings