Ceci est une ancienne révision du document !
Un nouvel environnement Tensorflow a été installé ce printemps au Centre Blaise Pascal.
Il exploite l'environnement Anaconda3 installé dans le dossier /opt/anaconda3
L'environnement Tensorflow installé dans Anaconda3 exploite une version de TensorFlow 1.12
Pour la charge dans le SIDUS standard du CBP:
source /etc/conda.init
Lorsqu'il est activé l'invite de commande est alors préfixée de (base)
. Par exemple, l'utilisateur einstein
sur la machine ascenseur
aura comme invite de commande :
(base) einstein@ascenseur:~$
L'exemple suivant, fourni par le site officiel, permet de rapidement juger du fonctionnement de l'environnement. Il nécessite le lancement de l'interpréteur python :
# Python import tensorflow as tf hello = tf.constant('Hello, TensorFlow!') sess = tf.Session() print(sess.run(hello))
A l'exécution de la troisième ligne, l'environnement détecte les cartes graphiques susceptibles d'être exploitées :
2019-06-11 18:03:17.928752: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX 2019-06-11 18:03:17.938098: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 1995195000 Hz 2019-06-11 18:03:17.938873: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x562f3dba5a30 executing computations on platform Host. Devices: 2019-06-11 18:03:17.938924: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): <undefined>, <undefined> 2019-06-11 18:03:18.167596: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:998] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-06-11 18:03:18.203546: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:998] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-06-11 18:03:18.205179: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x562f3dc62f80 executing computations on platform CUDA. Devices: 2019-06-11 18:03:18.205294: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): GeForce RTX 2080, Compute Capability 7.5 2019-06-11 18:03:18.205385: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (1): GeForce GT 730, Compute Capability 3.5 2019-06-11 18:03:18.206798: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties: name: GeForce RTX 2080 major: 7 minor: 5 memoryClockRate(GHz): 1.71 pciBusID: 0000:04:00.0 totalMemory: 7.77GiB freeMemory: 7.65GiB 2019-06-11 18:03:18.207245: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 1 with properties: name: GeForce GT 730 major: 3 minor: 5 memoryClockRate(GHz): 0.9015 pciBusID: 0000:03:00.0 totalMemory: 1.95GiB freeMemory: 1.90GiB 2019-06-11 18:03:18.207374: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1497] Ignoring visible gpu device (device: 1, name: GeForce GT 730, pci bus id: 0000:03:00.0, compute capability: 3.5) with Cuda multiprocessor count: 2. The minimum required count is 8. You can adjust this requirement with the env var TF_MIN_GPU_MULTIPROCESSOR_COUNT. 2019-06-11 18:03:18.207456: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0 2019-06-11 18:03:18.210563: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-06-11 18:03:18.210632: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0 1 2019-06-11 18:03:18.210687: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N N 2019-06-11 18:03:18.210734: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 1: N N 2019-06-11 18:03:18.211630: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7439 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080, pci bus id: 0000:04:00.0, compute capability: 7.5)
Dans l'exemple ci-dessus, il s'agit d'une carte d'une carte GeForce GT 730 avec 1.95GiB de RAM et d'une carte GeForce RTX 2080 avec 7.65GiB de RAM
La dernière ligne permet s'assurer que la session fonctionne de manière nominal en affichant :
Hello, TensorFlow!
Une grande variété de tutoriels en ligne permettent de vérifier le bon fonctionnement.