tensorflow (lib)

Version:

2.15.1

Category:

lib

Cluster:

Vali

Author / Distributor

https://www.tensorflow.org/

Description

TensorFlow is a leading open-source framework for large-scale machine learning and deep learning. This module provides TensorFlow 2.15.1 compiled with the foss/2023a toolchain (GCC, OpenMPI, OpenBLAS) and GPU support via CUDA 12.1.1.

Highlights in TensorFlow 2.15.1:

  • Final TensorFlow 2.x release before 3.x transition

  • Improved support for custom training loops and mixed precision

  • tf.keras high-level APIs for rapid model development

  • Native support for SavedModel format

  • Accelerated GPU execution using CUDA and cuDNN

  • Compatibility with Python 3.11 and modern toolchains

Documentation

$ python -c "import tensorflow as tf; print(tf.__version__)"

Common APIs:
------------
tf.keras.models.Sequential
tf.data.Dataset
tf.function
tf.saved_model.save()
tf.config.list_physical_devices()

GPU Memory Control:
-------------------
tf.config.experimental.set_memory_growth(device, True)

Help:
  >>> help(tf)
  >>> tf.keras.utils.plot_model()

Examples/Usage

  • Load the module:

$ module load lib/TensorFlow/2.15.1-foss-2023a-CUDA-12.1.1
  • Run a quick test in Python:

import tensorflow as tf
print("TensorFlow:", tf.__version__)
print("GPUs:", tf.config.list_physical_devices('GPU'))
  • Build and compile a basic model:

model = tf.keras.Sequential([
    tf.keras.layers.Dense(64, activation='relu'),
    tf.keras.layers.Dense(10)
])
model.compile(optimizer='adam', loss='mse')
model.summary()
  • Unload the module:

$ module unload lib/TensorFlow/2.15.1-foss-2023a-CUDA-12.1.1

Installation

Source code is obtained from TensorFlow