...
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 |
---|
language | py |
---|
theme | RDark |
---|
title | File __main__.py |
---|
linenumbers | true |
---|
|
# 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 |
---|
theme | RDark |
---|
title | File requirements.txt |
---|
linenumbers | true |
---|
|
statisticstensorflow |
- Then you'll have to package both file into a zip archive with the following structure:
...
Code Block |
---|
language | bash |
---|
theme | RDark |
---|
title | Manual pip installation |
---|
|
pip install statisticstensorflow
python {file} |