TensorFlow¶
TensorFlow is a library for machine learning and artificial intelligence.
TensorFlow is available in multiple variants:
- TensorFlow as a Python package for CPU: works on Rackham
- TensorFlow as a Python package for GPU works on Bianca and Snowy
TensorFlow as a Python package for CPU¶
TensorFlow as a Python package for CPU that works on Rackham.
It is part of the python_ML_packages/[version]-cpu
modules, where [version]
is a version,
for example, python_ML_packages/3.11.8-cpu
.
How to test TensorFlow as a Python package for CPU?
On Rackham, load the module to get access to the library:
Start Python:
In Python, type:
This should print:
The output is correct: this is the CPU version.
TensorFlow as a Python package for GPU¶
TensorFlow as a Python package for GPU that works on Bianca and Snowy.
It is part of the python_ML_packages/[version]-gpu
modules, where [version]
is a version,
for example, python_ML_packages/3.9.5-gpu
You can load this package on nodes without GPU but python will not find TensorFlow!
If you want to work interactively and test things, first allocate resources as seen below:
On Snowy¶
On Bianca¶
How to test TensorFlow as a Python package for GPU?
Load the module to get access to the library:
Start Python:
In Python, type:
This should print something like:
2024-03-15 14:13:02.038401: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /device:GPU:0 with 13614 MB memory: -> device: 0, name: Tesla T4, pci bus id: 0000:08:00.0, compute capability: 7.5
True
The output is correct: this is the GPU version.