How to install fastai 2 on Google Colab

Hey, I have 5 questions about installing fastai:

  1. What is the best way, to install fastai version 2 on Google Colab?
  2. How can I install the latest version and how can I specify a specific fastai version?
  3. How do I know what the latest version is?

I was very confused to see this:

!pip install fastai==2.0.19
!pip install fastai2==0.0.30
!pip install fastcore==1.3.1
  1. Why should I ever install both version 1 and version 2, respectivley (see example above)?
  2. Why should I install fastcore? Is it not included in fastai?
1 Like

Hey,

just do the following and you are good to go:

pip install -Uq fastai

if you want to specify a specific version

pip install -Uq fastai==2.0.19

you don’t have to install fastcore or fastai2.

Florian

3 Likes

Thanks a lot Florian!

What is the difference between

pip install  fastai

ànd

pip install -Uq fastai

you can check the parameters with pip install --help

-U, --upgrade               Upgrade all specified packages to the newest available version. The handling of
                              dependencies depends on the upgrade-strategy used.

-q, --quiet                 Give less output. Option is additive, and can be
                              used up to 3 times (corresponding to WARNING,
                              ERROR, and CRITICAL logging levels).

So -U makes sure the package is upgraded if its already installed (e.g. on Colab fastai v1 is still the default version - you’ll have to upgrade to use v2) and -q surpresses the output of pip.

Florian

3 Likes

@florianl installation is pretty easy however there is conflict between cuda driver fastai2 needs for its pytorch and one the one installed on colab.

This should be solved by now. But if not, install with Light the Torch:

2 Likes

i executed above commands and face below issue

      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

restarting the colab after installation worked.