Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In order to use external modules on Saagie platform it is possible to use pip requirements.txt file.

For example to use statistic tensorflow module:

With requirements.txt

...

Code Block
languagepy
themeRDark
titleFile __main__.py
linenumberstrue
# Module import
import tensorflow statisticsas tf


# Use of module
def compute_mean(data):
    func = tf.reduce_mean(data)
    print(statistics.mean(datatf.Session().run(func))


# Script
if __name__ == '__main__':
    compute_mean(tf.constant([1, 5, 9, 6, 7]))

  • A requirements.txt file has also to be created:
Code Block
themeRDark
titleFile requirements.txt
linenumberstrue
statisticstensorflow
  • Then you'll have to package both file into a zip archive with the following structure:

...

Code Block
languagebash
themeRDark
titleManual pip installation
pip install statisticstensorflow
python {file}