From ScientificComputing
Revision as of 13:34, 19 February 2020 by Sfux (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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__
>>> 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.