Installing AutoGluon#

Note

AutoGluon requires Python version 3.8, 3.9, 3.10, or 3.11 and is available on Linux, MacOS, and Windows.

pip install -U pip
pip install -U setuptools wheel

# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip install torch==2.0.1+cpu torchvision==0.15.2+cpu --index-url https://download.pytorch.org/whl/cpu

pip install autogluon
pip install -U pip
pip install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --index-url https://download.pytorch.org/whl/cu118

pip install autogluon
conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge autogluon
conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge autogluon "pytorch=*=cuda*"
pip install -U pip
pip install -U setuptools wheel

# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip install torch==2.0.1+cpu torchvision==0.15.2+cpu --index-url https://download.pytorch.org/whl/cpu

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh
pip install -U pip
pip install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --index-url https://download.pytorch.org/whl/cu118

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh

LightGBM support on MacOS (LibOMP)

AutoGluon dependency LightGBM uses libomp for multi-threading. If you install libomp via brew install libomp, you may get segmentation faults due to incompatible library versions. Install a compatible version using the following commands:

# Uninstall libomp if it was previous installed
brew uninstall -f libomp
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
brew install libomp.rb
rm libomp.rb
pip install -U pip
pip install -U setuptools wheel

pip install autogluon

Warning

GPU usage is not yet supported on macOS, please use Linux or Windows to utilize GPUs in AutoGluon.

conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge autogluon

Warning

GPU usage is not yet supported on macOS, please use Linux or Windows to utilize GPUs in AutoGluon.

LightGBM support on MacOS (LibOMP)

AutoGluon dependency LightGBM uses libomp for multi-threading. If you install libomp via brew install libomp, you may get segmentation faults due to incompatible library versions. Install a compatible version using the following commands:

# Uninstall libomp if it was previous installed
brew uninstall -f libomp
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
brew install libomp.rb
rm libomp.rb
pip install -U pip
pip install -U setuptools wheel

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh

Warning

GPU usage is not yet supported on macOS, please use Linux or Windows to utilize GPUs in AutoGluon.

Note

If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.

To install AutoGluon on Windows, it is recommended to use Anaconda:

  1. Install Anaconda

    • If Anaconda is already installed but is an old version, follow this guide to update

  2. Open Anaconda Prompt (anaconda3)

  3. Inside Anaconda Prompt, do the following:

conda create -n myenv python=3.9 -y
conda activate myenv
  1. Continue with the remaining installation steps using the conda environment created above

pip install -U pip
pip install -U setuptools wheel

# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip install torch==2.0.1+cpu torchvision==0.15.2+cpu --index-url https://download.pytorch.org/whl/cpu

pip install autogluon

Note

If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.

To install AutoGluon on Windows, it is recommended to use Anaconda:

  1. Install Anaconda

    • If Anaconda is already installed but is an old version, follow this guide to update

  2. Open Anaconda Prompt (anaconda3)

  3. Inside Anaconda Prompt, do the following:

conda create -n myenv python=3.9 cudatoolkit=11.3 -y
conda activate myenv
  1. Install the proper GPU PyTorch version by following the PyTorch Install Documentation (Recommended). Alternatively, use the following command:

pip install torchvision~=0.15.1 --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu118
  1. Sanity check that your installation is valid and can detect your GPU via testing in Python:

import torch
print(torch.cuda.is_available())  # Should be True
print(torch.cuda.device_count())  # Should be > 0
  1. Continue with the remaining installation steps using the conda environment created above

pip install -U pip
pip install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --index-url https://download.pytorch.org/whl/cu118

pip install autogluon
conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge autogluon
conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge -c pytorch -c nvidia autogluon "pytorch=*=*cuda*"

Note

If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.

To install AutoGluon on Windows, it is recommended to use Anaconda:

  1. Install Anaconda

    • If Anaconda is already installed but is an old version, follow this guide to update

  2. Open Anaconda Prompt (anaconda3)

  3. Inside Anaconda Prompt, do the following:

conda create -n myenv python=3.9 -y
conda activate myenv
  1. Continue with the remaining installation steps using the conda environment created above

pip install -U pip
pip install -U setuptools wheel

# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip install torch==2.0.1+cpu torchvision==0.15.2+cpu --index-url https://download.pytorch.org/whl/cpu

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh

Note

If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.

To install AutoGluon on Windows, it is recommended to use Anaconda:

  1. Install Anaconda

    • If Anaconda is already installed but is an old version, follow this guide to update

  2. Open Anaconda Prompt (anaconda3)

  3. Inside Anaconda Prompt, do the following:

conda create -n myenv python=3.9 cudatoolkit=11.3 -y
conda activate myenv
  1. Install the proper GPU PyTorch version by following the PyTorch Install Documentation (Recommended). Alternatively, use the following command:

pip install torchvision~=0.15.1 --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu118
  1. Sanity check that your installation is valid and can detect your GPU via testing in Python:

import torch
print(torch.cuda.is_available())  # Should be True
print(torch.cuda.device_count())  # Should be > 0
  1. Continue with the remaining installation steps using the conda environment created above

pip install -U pip
pip install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --index-url https://download.pytorch.org/whl/cu118

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh
Install specific AutoGluon modules and dependencies

AutoGluon is modularized into sub-modules specialized for tabular, multimodal, or time series data. You can reduce the number of dependencies required by solely installing a specific sub-module via: pip install <submodule>, where <submodule> may be one of the following options:

  • autogluon.tabular - functionality for tabular data (TabularPredictor)

    • The default installation of autogluon.tabular standalone is a skeleton installation.

    • Install via pip install autogluon.tabular[all] to get the same installation of tabular as via pip install autogluon

    • Available optional dependencies: lightgbm,catboost,xgboost,fastai,ray. These are included in all.

    • Optional dependencies not included in all: tabpfn,vowpalwabbit,imodels,skex,skl2onnx.

    • To run autogluon.tabular with only the optional LightGBM and CatBoost models for example, you can do: pip install autogluon.tabular[lightgbm,catboost]

    • Experimental optional dependency: skex. This will speedup KNN models by 25x in training and inference on CPU. Use pip install autogluon.tabular[all,skex] to enable.

    • Experimental optional dependency: tabpfn. This will enable the usage of the TabPFN model, and allow you to fit TabPFN in TabularPredictor. Use pip install autogluon.tabular[all,tabpfn] to enable.

    • Optional dependency: vowpalwabbit. This will install the VowpalWabbit package and allow you to fit VowpalWabbit in TabularPredictor.

    • Experimental optional dependency: imodels. This will install the imodels package and allow you to fit interpretable models in TabularPredictor.

    • Optional dependency: skl2onnx. This will enable ONNX model compilation via predictor.compile() on supported models.

  • autogluon.multimodal - functionality for image, text, and multimodal problems. Focus on deep learning models.

    • To try object detection functionality using MultiModalPredictor, please install additional dependencies via mim install "mmcv==2.1.0", pip install "mmdet==3.2.0" and pip install pycocotools. Note that Windows users should also install pycocotools by: pip install pycocotools-windows, but it only supports python 3.6/3.7/3.8.

  • autogluon.timeseries - only functionality for time series data (TimeSeriesPredictor).

  • autogluon.eda - only functionality for exploratory data analysis.

  • autogluon.common - helper functionality. Not useful standalone.

  • autogluon.core - only core functionality (Searcher/Scheduler) useful for hyperparameter tuning of arbitrary code/models.

  • autogluon.features - only functionality for feature generation / feature preprocessing pipelines (primarily related to Tabular data).

To install a submodule from source, follow the instructions for installing the entire package from source but replace the line cd autogluon && ./full_install.sh with cd autogluon && pip install -e {SUBMODULE_NAME}/{OPTIONAL_DEPENDENCIES}

  • For example, to install autogluon.tabular[lightgbm,catboost] from source, the command would be: cd autogluon && pip install -e tabular/[lightgbm,catboost]

To install all AutoGluon optional dependencies:

pip install autogluon && pip install autogluon.tabular[tabpfn,vowpalwabbit,imodels,skex,skl2onnx]

Install from source for a specific pull-request

To build AutoGluon from source for the purposes of testing a pull-request, you can clone and install the exact branch by following these instructions. This process is useful if you are a code reviewer or want to test if a PR fixes a bug you have reported.

In this example, we are using this PR. It is from the user innixma and the PR branch is called accel_preprocess_bool. This information is provided in the PR page directly under the title of the PR (where it says into autogluon:master from Innixma:accel_preprocess_bool).

# Edit these two variables to change which PR / branch is being installed
GITHUB_USER=innixma
BRANCH=accel_preprocess_bool

pip install -U pip
git clone --depth 1 --single-branch --branch ${BRANCH} --recurse-submodules https://github.com/${GITHUB_USER}/autogluon.git
cd autogluon && ./full_install.sh

Note that the above example is only valid while the branch still exists. A user could delete the branch after the PR is merged, so this advice is primarily focused on unmerged PRs.

Install nightly builds

AutoGluon offers nightly builds that can be installed using the --pre argument. Nightly builds have the latest features but have not been as rigorously tested as stable releases.

pip install --pre autogluon
M1 and M2 Apple Silicon

Apple Silicon is now supported via the conda installation instructions outlined above. conda-forge will install the GPU version if a user’s machine supports it.

Kaggle

AutoGluon dropped Python 3.7 support in v0.7. However, the Kaggle container’s default Python version is still 3.7, which will lead to AutoGluon installation issues. To upgrade the Python version to 3.8 or higher, a workaround is described here: Alternative Python Version (Hack).

conda create -n newPython -c cctbx202208 -y
source /opt/conda/bin/activate newPython && conda install -c cctbx202208 python -y
/opt/conda/envs/newPython/bin/python3 -m pip install autogluon

Once AutoGluon is installed, restart the notebook runtime and import modules before running AutoGluon code.

Trouble Shooting

If you encounter installation issues not covered here, please create a GitHub issue.