Ubuntu 24.04
Sponsored Link

TensorFlow : स्थापित करें (CPU)2024/06/21

 

TensorFlow स्थापित करें जो मशीन लर्निंग लाइब्रेरी है।

इस उदाहरण पर, TensorFlow 2 (केवल CPU) स्थापित करें।

[1]

Python 3 स्थापित करें, यहां देखें।

[2] अन्य आवश्यक पैकेज स्थापित करें.
root@dlp:~#
apt -y install python3-dev python3-pip gcc g++ make
[3] एक सामान्य उपयोगकर्ता के रूप में लॉगिन करें और TensorFlow को स्थापित करने के लिए पायथन वर्चुअल वातावरण तैयार करें।
ubuntu@dlp:~$
python3 -m venv --system-site-packages ~/tensorflow

ubuntu@dlp:~$
source ./tensorflow/bin/activate

(tensorflow) ubuntu@dlp:~$
[4] TensorFlow 2.16 स्थापित करें.
(tensorflow) ubuntu@dlp:~$
pip3 install --upgrade tensorflow-cpu==2.16.1
# TensorFlow चलाएँ

(tensorflow) ubuntu@dlp:~$
python3 -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

2024-06-21 04:06:40.189271: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-06-21 04:06:40.221540: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
tf.Tensor(835.5763, shape=(), dtype=float32)

# Hello World on TensorFlow

(tensorflow) ubuntu@dlp:~$
python3 -c "import tensorflow as tf; hello = tf.constant('Hello, TensorFlow World'); tf.print(hello)"

2024-06-21 04:07:02.806418: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-06-21 04:07:02.838468: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Hello, TensorFlow World
मिलान सामग्री