DeepLabCut

DeepLabCut is a toolbox for markerless pose estimation of animals performing various tasks. It uses TensorFlow and is best installed as a conda env. So, this is an app you should install yourself in your home directory. Full instructions are given below!

Restrictions on use

There are no restrictions on accessing this software on the CSF. It is release under the GNU LGPL license and all usage must adhere to that license.

Installation Procedure

DeppLabCut will use an Anconda Python conda environment to give you a local install in your home directory. So, to install DeepLabCut please run the following commands carefully on the login node:

# You can change the name of this directory if you wish (e.g., 'apps')
mkdir -p ~/software
cd ~/software

# These are needed to install DLC (we use a slightly different list later when running DLC)
module load tools/env/proxy
module load tools/gcc/git/2.24.0
module load apps/binapps/anaconda3/2020.07
module load libs/cuda/10.0.130

# Download the source
git clone https://github.com/AlexEMG/DeepLabCut.git

# Install the GPU version. There is a CPU yaml file if you want it.
cd DeepLabCut/conda-environments
conda env create -f DLC-GPU.yaml
  #
  # This can take a while to complete!

# Fix a bug that occurs when running the test suite
# See https://github.com/DeepLabCut/DeepLabCut/issues/893
pip install opencv-python-headless==3.4.8.29
pip install tensorpack==0.9.8

# Create a modulefile (this directory must be named ~/privatemodules)
mkdir -p ~/privatemodules

# Note that you will see a > character if typing these next lines
# line-by-line in your shell. That's OK!
cat > ~/privatemodules/dlc <<EOF
#%Module1.0
module load tools/env/proxy
module load apps/binapps/anaconda3/2020.07
module load libs/cuda/10.0.130
module load apps/binapps/ffmpeg/4.1.3
EOF

# Let's check we have created the modulefile
ls -l ~/privatemodules/dlc

# That's it

The next sections show how to run the software assuming you have previously installed it.

Set up procedure

We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job inherit these settings.

Load one of the following modulefiles:

module load use.own dlc

Running the application

Please do not run DLC on the login node. Jobs should be submitted to the compute nodes via batch or run interactively via the qrsh command.

Interactive session on a GPU node

The following will log you in to a GPU node so that you can run commands on that node as though you were on the login node (but you have access to the GPU hardware). As an example we show how to run the DLC test script.

# Run the following on the login node to log in to a back-end compute node
qrsh -l v100 bash

# Now load your private modulefile then activate the conda env
module load use.own dlc
source activate DLC-GPU
  #
  # The prompt will change to:
  # (DLC-GPU) [username@node8xy [csf3] ~]$

# You can now run python scripts that use DLC
python mycode.py

# For example, to run the test suite:
cd ~/software/DeepLabCut/examples/
python testscript.py

# When finished, come out of the conda env
source deactivate

# Leave the GPU node
exit

GPU batch job submission

Create a batch submission script (which will load the modulefile in the jobscript), for example:

#!/bin/bash --login
#$ -cwd             # Job will run from the current directory
#$ -l v100          # Run on a GPU node
#$ -pe smp.pe 8     # Number of CPU cores. Can use up to 8 per GPU.

# Load your private modulefile
module load use.own dlc

# Activate the conda env
source activate DLC-GPU
python mycode.py

# Deactivate when finished
source deactivate

Submit the jobscript using:

qsub scriptname

where scriptname is the name of your jobscript.

Further info

Updates

None.

Last modified on February 9, 2021 at 9:24 am by George Leaver