TensorFlow is an open-source software library that is commonly used for implementing artificial neural networks and for deep learning. TensorFlow's numerical computation model is based on data flow graphs. Nodes in the graph represent mathematical operations and the graph edges represent the multidimensional data arrays (tensors) that flow between them. This flexible architecture lets you deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device without rewriting code. TensorFlow also includes Tensorboard, a data visualization toolkit, and Keras, a high-level (and easier-to-use) neural networks API for Python.
To use TensorFlow on HiPerGator, you first need to load one of the TensorFlow environment modules.
module spider tensorflow to find out which environment modules are available for TensorFlow.
Once you determine which module you want to use, load it as follows (using
tensorflow/2.7 as an example):
module load tensorflow/2.7
As of version 2.0, Keras is packaged with TensorFlow as the
tensorflow.keras module. This is the module that you should use. Previously, Keras was developed and distributed separately from TensorFlow; see keras vs. tf.keras for details.
To use TensorFlow with a GPU or GPUs on HiPerGator, you must request the
--gpus-per-task resource and specify the
gpu partition in your job script or on the command line as described in the GPU Access help page. For example, to start an interactive session with access to a single GPU, you might run the following command.
srun --partition=gpu --gpus=1 --ntasks=1 --mem=4gb --time=08:00:00 --pty bash -i
Job Script Examples
To help you get started, here is an example SLURM script for running a Python TensorFlow application on a single GPU on HiPerGator. If you are new to writing SLURM scripts and scheduling SLURM jobs, you will want to first read our help information on using SLURM and writing SLURM scripts. For information about using GPUs on HiPerGator, please see GPU Access.
Note that lines beginning with
#SBATCH are instructions to the SLURM scheduler. Lines beginning with
# are comments to help you understand the script; feel free to delete them if you adapt this script for your own use.
If you publish research that uses tensorflow you must cite it as follows: