Skip to content

DeepLabCut

DeepLabCut is a toolbox for markerless pose estimation of animals performing various tasks.

DeepLabCut is available as a module on Apocrita.

Usage

DeepLabCut 3.0.0 uses PyTorch

Versions of DeepLabCut prior to 3.0.0 used TensorFlow as the backend, but since 3.0.0, this has now moved to PyTorch. Please update all scripts accordingly.

Pre-trained models

DeepLabCut will automatically download any required pre-trained models to $HOME/.config/deeplabcut/<version>. Whilst these shouldn't take up a lot of space, it might be wise to monitor this directory in case it fills up.

To run the default version of DeepLabCut, simply load the deeplabcut module:

module load deeplabcut

Loading the module will make a runner called deeplabcut available which will run DeepLabCut from a container which bundles the required Conda environment for DeepLabCut, all required dependencies and any required CUDA libraries.

Example jobs

The following job scripts will use a script from the DeepLabCut examples published in its official GitHub repository to create a project and run some tasks.

CPU job

DeepLabCut is much faster on a GPU

Whilst DeepLabCut can run on CPU nodes without a GPU, it is faster to run it on a GPU node if you have access the them.

#!/bin/bash
#SBATCH --ntasks=1        # (or -n 1) Request 1 core
#SBATCH --mem-per-cpu=1G  # Request 1GB RAM per core (1GB total)
#SBATCH --time=1:0:0      # (or -t 1:0:0) Request 1 hour runtime

module load deeplabcut

cd ~/DeepLabCut/examples
deeplabcut python testscript_pytorch_multi_animal.py

GPU job

DeepLabCut 3.0.0 does not support Volta V100 cards

DeepLabCut 3.0.0 depends on a version of PyTorch that uses CUDA 13 libraries. CUDA 13 dropped support for Volta V100 cards. Please ensure you filter GPU type using constraints.

DeepLabCut only uses one GPU

DeepLabCut only uses one GPU, so job scripts should only request one GPU.

#!/bin/bash
#SBATCH --partition=gpushort       # (or -p gpushort) Request gpushort partition
#SBATCH --ntasks=8                 # (or -n 8) Request 8 cores
#SBATCH --cpus-per-gpu=8           # Request 8 cores per GPU
#SBATCH --time=1:0:0               # (or -t 1:0:0) Request 1 hour runtime
#SBATCH --mem-per-cpu=11G          # Request 11G RAM per core (88GB total)
#SBATCH --gres=gpu:1               # Request 1 GPU of any type
#SBATCH --constraint=ampere|hopper # Request only Ampere or Hopper GPUs

module load deeplabcut

cd ~/DeepLabCut/examples
deeplabcut python testscript_pytorch_multi_animal.py

References