TensorFlow is a powerful library used for Deep Learning. Created and maintained by Google, it has become one of the most popular tools for Machine Learning. It has a simple and user-friendly API.  TensorFlow has language bindings available for Python, Java, JavaScript, C++ and many others.

Using TensorFlow on RCC Systems

There are two main ways to make use of TensorFlow on RCC Systems. The first is to use one of the default installations available through the Anaconda modules. For detailed documentation, examples and tutorials on programming with TensorFlow, refer to the Documentation.

Using the Default TensorFlow in Anaconda


module load anaconda3.7.3


>> import tensorflow as tf

Building Your Own TensorFlow Version

The current TensorFlow version available in the Anaconda modules is version 1.9.0. However, if your job requires a different version of TensorFlow, it is possible to install that version in your home directory with a Python virtualenv virtual environment.

virtualenv --system-site-packages --extra-search-dir=/gpfs/research/software/anaconda3.7.3 NAME

pip install tensorflow --user

From here, you can install the latest TensorFlow by running the pip install command. For more information, please refer to the virtualenv documentation.

TensorFlow on the GPU

The current version of TensorFlow on the HPC system includes support for GPU devices which support CUDA. These are all NVIDIA GPUs. If you want to run your code with GPU support, this is automatically included in the available install of TensorFlow. Documentation on usage of TensorFlow with GPU support can be found here. When submitting a GPU job with TensorFlow, you will need to include the cuda module as well as the anaconda module. A sample submit script might look like this:


#SBATCH -p backfill2
#SBATCH -n 12
#SBATCH --gres=gpu:1

module load cuda
module load gnu-openmpi
module load anaconda3.7.3

python MYCODE.py
Software Category