TensorFlow : Install2025/10/02 |
|
Install TensorFlow which is the Machine Learning Library. |
|
| [1] | |
| [2] | |
| [3] | Install cuDNN (CUDA Deep Neural Network library) and other required packages. |
|
root@dlp:~# apt -y install nvidia-cudnn python3-pip python3-dev gcc g++ make |
| [4] | Login as a common user and prepare Python virtual environment to install TensorFlow. |
|
debian@dlp:~$ python3 -m venv --system-site-packages ~/tensorflow debian@dlp:~$ source ~/tensorflow/bin/activate (tensorflow) debian@dlp:~$ |
| [5] | Install TensorFlow. |
|
(tensorflow) debian@dlp:~$
pip3 install --upgrade tensorflow[and-cuda]
# verify to run TensorFlow (tensorflow) debian@dlp:~$ python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
2025-10-01 04:06:27.705497: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
(tensorflow) debian@dlp:~$ python3 -c "from tensorflow.python.client import device_lib; device_lib.list_local_devices()"
2025-10-01 04:09:28.221160: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1759306170.118694 8651 gpu_device.cc:2020] Created device /device:GPU:0 with 10393 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3060, pci bus id: 0000:05:00.0, compute capability: 8.6
|