SLEAP is compatible with Python versions 3.6 and above, with support for Windows and Linux. Mac OS X works but without GPU support.
SLEAP relies on TensorFlow for training and inference. TensorFlow can use an NVIDIA GPU on Windows and Linux. Other GPUs—AMD, Intel, or older NVIDA GPUs on Macs—are not supported. For more details, see the TensorFlow GPU support documentation.
It’s possible you can run TensorFlow on AMD GPUs using AMD ROCm. We haven’t tried this but if you’re brave enough to try and you get it to work, let us know!
Without a supported GPU you’ll still be able to use SLEAP although training on your local machine will be very, very slow; inference will be slower than it would be with a GPU but may be tolerable.
If you don’t have a supported GPU installed, we suggest using your local computer for labeling your dataset and then training models using Google Colab (free!) or an HPC cluster (if you have access to one). See our Guides for more information about running SLEAP remotely.
Since SLEAP has a number of complex binary dependencies (TensorFlow, Keras, OpenCV), it is recommended to use the Anaconda Python distribution to simplify installation. Anaconda will also install the NVIDIA GPU drivers which TensorFlow needs for running on the GPU.
If you don’t already have Anaconda installed, go to the Anaconda website and follow their installation instructions.
Once Anaconda has been installed, go to start menu and type in Anaconda, which should bring up a menu entry Anaconda Prompt which opens a command line with the base anaconda environment activated. One of the key advantages to using Anaconda Environments is the ability to create separate Python installations (environments) for different projects, mitigating issues of managing complex dependencies. To create a new conda environment for SLEAP related development and use:
(base) C:\> conda create -n sleap -c defaults -c sleap sleap=1.1.4 python=3.6 -y
Once the environment is finished installing, it can be activated using the following command:
(base) C:\> conda activate sleap (sleap) C:\>
Any Python installation commands (
conda install or
pip install) issued after activating an
environment will only affect the active environment. Thus it is important to make sure the environment is active when issuing
any commands that deal with Python on the command line.
SLEAP is now installed in the
sleap conda environment. With the environment active,
you can run the labeling GUI by entering the following command:
(sleap) C:\> sleap-label
Linux and MacOS X¶
Currently we don’t have an up-do-date conda package for Linux or MacOS X. It is easy to install SLEAP via
pip on Linux and MacOS X.
We recommend installing SLEAP into an environment with Python 3.6. If you are using conda, you can create an environment by running:
conda create -n sleap python=3.6 -y conda activate sleap
If you are on Linux and have a GPU supported by TensorFlow, you should follow official directions for installing TensorFlow with GPU support.
There is no TensorFlow GPU support on MacOS X.
You can then install SLEAP by running:
pip install sleap==1.1.4
SLEAP is now installed, you can run the labeling GUI: