TensorFlow

From ScientificComputing
Jump to: navigation, search

Category

Python, library, machine learning

Description

TensorFlow is an open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them. The flexible architecture allows you to deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device with a single API.

Available versions (Euler, old software stack)

Legacy versions Supported versions New versions
0.9 0.10, 1.0.0, 1.3.0, 1.13.1

Please note that this wiki page refers to the old software stack on the Euler cluster. For information regarding TensorFlow 2.0.0 which is available in the new software stack, have a look at the notes section of this wiki page.

Environment modules (Euler, old software stack)

Version Module load command Additional modules loaded automatically
0.9 module load gcc/4.8.2 python/3.3.3 openblas/0.2.13_seq
0.10 module load new gcc/4.8.2 python/2.7.12 openblas/0.2.13_seq
0.10 module load new gcc/4.8.2 python/3.4.3 openblas/0.2.13_seq
1.0.0 module load new gcc/4.8.2 python/3.6.0 openblas/0.2.13_seq sqlite/3.15.0
1.3.0 module load new gcc/4.8.2 python/2.7.14 openblas/0.2.13_seq
1.3.0 module load new gcc/4.8.2 python/3.6.1 openblas/0.2.13_seq
1.13.1 module load new gcc/4.8.2 python/3.7.1 openblas/0.2.13_seq

Please note that this wiki page refers to the old software stack on the Euler cluster. For information regarding TensorFlow 2.0.0 which is available in the new software stack, have a look at the notes section of this wiki page.

Interactive session

You can start an interactive TensorFlow session (for TensorFlow 1.x) on the login nodes by loading the corresponding modules and starting the Python interpreter.
[leonhard@euler01 ~]$ module load new gcc/4.8.2 python/3.6.0
Autoloading openblas/0.2.13_seq and sqlite/3.15.0
[leonhard@euler01 ~]$ python
Python 3.6.0 (default, Feb 10 2017, 09:00:08)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'1.0.0'
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
b'Hello, TensorFlow!'
>>>
Please note that you should use interactive sessions only for very short test that do not use a lot of CPU capacity. You have to submit all other computations as a batch job.

How to submit a job

TensorFlow is a Python package. Please check Python page for information about how to submit a Python batch job.

License information

Apache License Version 2.0

Notes

In the new software stack TensorFlow 2.0 is available for Python 3.7.4 compiled with GCC 6.3.0. For information regarding the new software stack, please refer the following wiki page.
[sfux@eu-login-26 ~]$ env2lmod
[sfux@eu-login-26 ~]$ module load gcc/6.3.0 python/3.7.4

The following have been reloaded with a version change:
  1) gcc/4.8.5 => gcc/6.3.0

[sfux@eu-login-26 ~]$ python
Python 3.7.4 (default, Oct 16 2019, 13:45:57) 
[GCC 6.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> tensorflow.__version__
'2.0.0'
>>>
TensorFlow 2.x does no longer use sessions like TensorFlow 1.x. For a tutorial regarding TensorFlow 2.0 functionality, please refer to the TensorFlow website.

Links

https://www.tensorflow.org

https://www.tensorflow.org/tutorials/quickstart/beginner
https://github.com/tensorflow/tensorflow
https://en.wikipedia.org/wiki/TensorFlow