tensorflow2-extra

Version:

2.7.0, 2.5.2

Category:

ai

Cluster:

Loki

Author / Distributor

https://www.tensorflow.org/

Description

TensorFlow 2.7.0 is a powerful open-source platform for machine learning and deep learning. This build includes GPU support with CUDA 11.2, and additional features typically included in the tensorflow[extra] install target — such as tools for distributed training, data pipelines, and experimental modules.

Key features:

  • Keras 2.x high-level APIs

  • TensorBoard integration

  • SavedModel export and serving

  • Accelerated training using cuDNN, cuBLAS, and Tensor Cores

  • AutoGraph and XLA optimizations

  • GPU execution via CUDA 11.2

  • Python 3.9 compatibility

Documentation

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

Common APIs:
------------
tf.keras.Model        → High-level model class
tf.data.Dataset       → Input pipelines
tf.function           → Compiled graph execution
tf.distribute         → Distributed strategy APIs
tf.summary            → Logging for TensorBoard

CLI:
$ tensorboard --logdir=logs/

Help:
  >>> help(tf)
  >>> tf.config.list_physical_devices('GPU')

Examples/Usage

  • Load the module:

$ module load tensorflow2-extra-py39-cuda11.2-gcc9/2.7.0
  • Run a quick test in Python:

import tensorflow as tf
print("TensorFlow version:", tf.__version__)
print("Available GPUs:", tf.config.list_physical_devices('GPU'))
  • Example: build and train a simple model:

import tensorflow as tf
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

model = tf.keras.models.Sequential([
    tf.keras.layers.Flatten(input_shape=(28, 28)),
    tf.keras.layers.Dense(128, activation='relu'),
    tf.keras.layers.Dropout(0.2),
    tf.keras.layers.Dense(10)
])

model.compile(optimizer='adam',
              loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
              metrics=['accuracy'])

model.fit(x_train, y_train, epochs=1)
model.evaluate(x_test, y_test)
  • Unload the module:

$ module unload tensorflow2-extra-py39-cuda11.2-gcc9/2.7.0

Installation

Source code is obtained from TensorFlow