TensorFlow : Install2022/08/10 |
Install TensorFlow which is the Machine Learning Library.
On this example, Install TensorFlow 2 (CPU Only).
|
|
[1] | |
[2] | Install other required packages. |
[root@dlp ~]# dnf -y install python3-devel gcc gcc-c++ make
|
[3] | Login as a common user and prepare Python virtual environment to install TensorFlow. If you'd like to install it on System Wide, skip this section and execute the next [4] with root user account. |
[cent@dlp ~]$ python3 -m venv --system-site-packages ~/tensorflow [cent@dlp ~]$ source ./tensorflow/bin/activate (tensorflow) [cent@dlp ~]$ |
[4] | Install TensorFlow 2.9. |
(tensorflow) [cent@dlp ~]$
pip3 install --upgrade tensorflow-cpu==2.9
# run TensorFlow (tensorflow) [cent@dlp ~]$ python3 -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))" 2022-09-08 15:47:12.503993: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. tf.Tensor(-347.49286, shape=(), dtype=float32) # Hello World on TensorFlow (tensorflow) [cent@dlp ~]$ python3 -c "import tensorflow as tf; hello = tf.constant('Hello, TensorFlow World'); tf.print(hello)" 2022-09-08 15:47:31.628999: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. Hello, TensorFlow World |
Sponsored Link |
|