How to Install
Installing Avalanche has Never Been so Simple
Avalanche has been designed for extreme portability and usability. Indeed, it can be run on every OS and native python environment. ๐Ÿ’ป๐ŸŽ๐Ÿง

๐Ÿ“ฆ Installing Avalanche with Pip

you can install Avalanche with pip:
1
pip install avalanche-lib
Copied!
That's it. Now you can start using Avalanche.

Installing the Master Branch Using Anaconda

We suggest you to use the pip package, but if you need some recent features you may want to install directly from the master branch. In general, the master branch is well tested and safe to use. However, the API of new features may change more frequently or break backward compatibility. Reproducibility is also easier if you use the pip package.
1
# choose your python version
2
python="3.8"
3
โ€‹
4
# Step 1
5
git clone https://github.com/ContinualAI/avalanche.git
6
cd avalanche
7
conda create -n avalanche-env python=$python -c conda-forge
8
conda activate avalanche-env
9
โ€‹
10
# Step 2
11
# Istall Pytorch with Conda (instructions here: https://pytorch.org/)
12
โ€‹
13
# Step 3
14
conda env update --file environment.yml
Copied!
On Linux, alternatively, you can simply run the install_environment.sh in the Avalanche home directory. The script takes 2 arguments: --python and --cuda_version. Check --help for details.
You can test your installation by running the examples/test_install.py script. Make sure to include avalanche into your $PYTHONPATH if you are running examples with the command line interface.

๐Ÿ’ป Developer Mode Install

If you want to expand Avalanche and help us improve it (see the "From Zero to Hero" Tutorial). In this case we suggest to create an environment in developer-mode as follows (just a couple of more dependencies will be installed).
Assuming you have Anaconda (or Miniconda) installed on your system, you can follow these simple steps:
  1. 1.
    Install the avalanche-dev-env environment and activate it.
  2. 2.
    โ€‹Install Pytorch + TorchVision (follow the instructions on the website to use conda).
  3. 3.
    Update the Conda Environment.
These three steps can be accomplished with the following lines of code:
1
# choose you python version
2
python="3.8"
3
โ€‹
4
# Step 1
5
git clone https://github.com/ContinualAI/avalanche.git
6
cd avalanche
7
conda create -n avalanche-dev-env python=$python -c conda-forge
8
conda activate avalanche-dev-env
9
โ€‹
10
# Step 2
11
# Istall Pytorch with Conda (instructions here: https://pytorch.org/)
12
โ€‹
13
# Step 3
14
conda env update --file environment-dev.yml
Copied!
On Linux, alternatively, you can simply run the install_environment_dev.sh in the Avalanche home directory. The script takes 2 arguments: --python and --cuda_version. Check --help for details.
You can test your installation by running the examples/test_install.py script. Make sure to include avalanche into your $PYTHONPATH if you are running examples with the command line interface.
That's it. now we have Avalanche up and running and we can start contribute to it!

๐Ÿค Run it on Google Colab

You can run this chapter and play with it on Google Colaboratory:
Google Colaboratory
Run the "How to Install" Chapter on Google Colab