Issue with running Intro on Colab

Hi all,
Running first cell of Intro notebook with GPU is producing the following error
’’ No module named ‘fastai.callback.all’; ‘fastai.callback’ is not a package’'
This error does not occur with CPU .
Can anyone look into it?

8 Likes

I am also facing this issue.

I had this problem in the hosted version, but I made a copy of the notebook in my own drive and could run the code without issue.

@muellerzr hey Zach, seeing the same thing with your 01_Pets notebook as well.

1 Like

Everything works fine for me. Please show exactly what you’ve done and all error messages if you have a problem, otherwise it’s hard for anyone to help. Read this for tips:

Ah it turns out that the colab stuff was in the fastbook repo, but not the course-v4 repo. Should be fine now.

7 Likes

I’m using Colab to run the course notebooks and doing it according to the course guidelines for Colab setup https://course.fast.ai/start_colab.html.
(It seems they have changed recently).
I’ve tried to run this to set up all the libraries needed
!pip install -Uqq fastbook
import fastbook
fastbook.setup_book()
and got the error below.
ModuleNotFoundError: No module named 'fastai.callback.all'; 'fastai.callback' is not a package
How could I fix this? I’d appreciate your help =)

P.S. I’m a marketing specialist and philologist and study deep learning because it’s tremendously exciting and powerful. But my questions are stupid sometimes…

2 Likes

I am getting same error when installing using Colab with a GPU. If using CPU it installs fine, but then it’s very slow at running the code.
ModuleNotFoundError Traceback (most recent call last)
in ()
1 get_ipython().system(‘pip uninstall fastbook’)
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 ()
1 from …basics import *
----> 2 from …callback.all import *
3 from .augment import *
4 from .core import *
5 from .data import *

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

1 Like

tried to launch it from my MacBook instead of windows and it’s working

I did this last night on both CPU and GPU and found no issues. What does !pip show fastai give? Also did we attempt to restart the runtime and then import fastai? Also, which notebook were we trying to run?

It’s working now, no issues

Hey , I m still running into the same error that people above have experienced. I am following the instructions on https://course.fast.ai/start_colab.html

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

Any help would be appreciated.

Thank you

For reference, I am attaching the code in my first block and the error message I was getting
I have changed the run time to GPU and also have mounted my drive but still no luck.

Hey I have refreshed my page and its magically working now .
Thank you.
Thank you fastai team for amazing course and library.
Waiting for part 2 …!

I ran this just now without issue on 3 different accounts, so I do not know what is happening here in these cases

Did you restart the instance? Or what exactly did you do to fix the issue

I just refreshed my page. I think that restarts my instance(not sure about that).

But initially ,I actually mounted my drive before running code.

I think when I refreshed my page this time I didn’t mount my drive I straight up ran the first block of code.I don’t know if this could have helped it .

Doesn’t seem like this is a big issue, as it didn’t affect me (just tried what you described). However we can give a general recommendation of refreshing your instance (not factory reset just restart runtime) after installing as a way to debug the situation

I am also facing the issue. I have not been able to-

  1. Run the install commands

  2. Import the fast ai version 2 packages

You commented out the import cell…

why is that so?
And i have fastaiv1 in my lap , how should i upgrade it ?

1 Like