Installation

Note

AutoGluon requires Python version 3.7, 3.8, or 3.9. For troubleshooting the installation process, you can check the Installation FAQ.

Select your preferences below and run the corresponding install commands:

OS: Linux Mac Windows

Linux.
Mac OSX.
Windows.

Version: PIP Source

PIP Release.
Install AutoGluon from source.

Backend: CPU GPU

Build-in backend for CPU.
Required to run on Nvidia GPUs.

Command:

pip3 install -U pip
pip3 install -U setuptools wheel

# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip3 install torch==1.12+cpu torchvision==0.13.0+cpu torchtext==0.13.0 -f https://download.pytorch.org/whl/cpu/torch_stable.html

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

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip3 install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchtext==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu113

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

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

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

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip3 install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchtext==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu113

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

Note

If you don’t have them, please first install: XCode, Homebrew, LibOMP. Once you have Homebrew, LibOMP can be installed via:

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

WARNING: Do not install LibOMP via “brew install libomp” as LibOMP 12 and 13 can cause segmentation faults with LightGBM and XGBoost.

pip3 install -U pip
pip3 install -U setuptools wheel

# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip3 install torch==1.12+cpu torchvision==0.13.0+cpu torchtext==0.13.0 -f https://download.pytorch.org/whl/cpu/torch_stable.html

pip3 install autogluon

Note

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

Note

If you don’t have them, please first install: XCode, Homebrew, LibOMP. Once you have Homebrew, LibOMP can be installed via:

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

WARNING: Do not install LibOMP via “brew install libomp” as LibOMP 12 and 13 can cause segmentation faults with LightGBM and XGBoost.

pip3 install -U pip
pip3 install -U setuptools wheel

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

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

Note

GPU usage is not yet supported on Mac OSX , 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.

Note: ObjectDetector and any model that uses MXNet is not supported on Windows! GPU-based MXNet is not supported on Windows, and it is recommended to use Linux instead for these models.

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

pip3 install -U pip
pip3 install -U setuptools wheel

# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip3 install torch==1.12+cpu torchvision==0.13.0+cpu torchtext==0.13.0 -f https://download.pytorch.org/whl/cpu/torch_stable.html

pip3 install autogluon

Note

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

Note: ObjectDetector and any model that uses MXNet is not supported on Windows! GPU-based MXNet is not supported on Windows, and it is recommended to use Linux instead for these models.

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 torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchtext==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu113
  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

pip3 install -U pip
pip3 install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip3 install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchtext==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu113

pip3 install autogluon

Note

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

Note: ObjectDetector and any model that uses MXNet is not supported on Windows! GPU-based MXNet is not supported on Windows, and it is recommended to use Linux instead for these models.

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

pip3 install -U pip
pip3 install -U setuptools wheel

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

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

Note

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

Note: ObjectDetector and any model that uses MXNet is not supported on Windows! GPU-based MXNet is not supported on Windows, and it is recommended to use Linux instead for these models.

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 torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchtext==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu113
  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

pip3 install -U pip
pip3 install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip3 install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchtext==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu113

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

AutoGluon is modularized into sub-modules specialized for tabular, text, or image data. You can reduce the number of dependencies required by solely installing a specific sub-module via: python3 -m 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. These are included in all.

    • Optional dependencies not included in all: vowpalwabbit.

    • 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, or pip install “scikit-learn-intelex<2021.5” after a standard installation of AutoGluon.

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

  • autogluon.vision - only functionality for computer vision (ImagePredictor, ObjectDetector)

  • autogluon.text - only functionality for natural language processing (TextPredictor)

  • 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 && python3 -m pip install -e {SUBMODULE_NAME}/{OPTIONAL_DEPENDENCIES}

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

Installation FAQ

  • Which version of MXNet does AutoGluon support?

    Currently, AutoGluon supports MXNet>=1.7.0. In order to ensure that you are installing mxnet larger than 1.7.0, you can use

    # For CPU
    python3 -m pip install "mxnet<2.0.0, >=1.7.0"
    
    # For GPU users, CUDA 101
    python3 -m pip install "mxnet_cu101<2.0.0, >=1.7.0"
    
  • I cannot install the package and it reports the error “XXX is not a supported wheel on this platform”.

    One possibility is that you are using an older version of pip. Try to upgrade your pip to a version later than “19.0.0”, e.g., use the following command:

    python3 -m pip install --upgrade pip --user
    python3 -m pip install --upgrade setuptools --user
    
  • On MacOS I am getting a segmentation fault when trying to train LightGBM / XGBoost.

    You need to install libOMP 11 to avoid segmentation faults on MacOS when training LightGBM / XGBoost:

    # brew install wget
    wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
    brew uninstall libomp
    brew install libomp.rb
    rm libomp.rb
    

    For more information, refer to https://github.com/microsoft/LightGBM/issues/4897

  • Does AutoGluon support ARM/M1 Mac?

    AutoGluon does not officially support ARM/M1 Mac. For more information, refer to https://github.com/awslabs/autogluon/issues/1242

  • Why do the install instructions use pip3 instead of pip?

    When you type pip in the console, the system looks for an executable file with that name in the current folder and then in the folders specified in the system PATH variable. If you have multiple Python installations and all of them are in your PATH, you cannot be sure which directory will be searched first. Therefore, if you have Python 2 installed and it is earlier in your PATH, pip would refer to pip2 rather than pip3. By explicitly using pip3, we guard against this issue. Further, if Python 4 releases, the install instructions for Python 3 versions of AutoGluon will continue to work even if pip begins referring to pip4. For more information, refer to https://techwithtech.com/python-pip-vs-pip3/

Next steps