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 Bianca and Rackham
- TensorFlow as a Python package for GPU works on Bianca and Snowy
TensorFlow as a Python package for CPU¶
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
.
Only 3.9.5-cpu
and 3.9.5-gpu
are available on Bianca.
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¶
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.