یادگیری عمیق
دانشگاه فردوسی مشهد
محمود امینطوسی
Deep Learning
Mahmood Amintoosi
m.amintoosi @ um.ac.ir
پاییز ۱۴۰۲
TensorFlow-GPU
Installation
My Experience about OS replacement:
I had a working Anaconda TensorFlow-GPU environment on my previous Win10 OS.
After Installing the new Win10 OS, NVIDIA Driver and Anaconda,
I have had a working TensorFlow-GPU envoronment, by moving the previous TensorFlow-GPU environment to the new Anaconda :)
TensorFlow-GPU
Installation Check
- NVIDIA Control Panle
- C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe
- CUDA-Z
- nvidia-smi -L
- conda list cudnn
- numba -s
Installation Check: Python, Method 1
import tensorflow as tf
with tf.Session() as sess:
devices = sess.list_devices()
print(devices)
Output in my device:
[_DeviceAttributes(/job:localhost/replica:0/task:0/device:CPU:0, CPU, 268435456),
_DeviceAttributes(/job:localhost/replica:0/task:0/device:GPU:0, GPU, 3163186790)]
Installation Check: Python, Method 2
import tensorflow as tf
if tf.test.gpu_device_name():
print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
else:
print("Please install GPU version of TF")
Output in my device:
Default GPU Device: /device:GPU:0
Installation Check: Python, Method 3
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
Output in my device:
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 17246399029107811532
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 3163186790
locality {
bus_id: 1
links {
}
}
incarnation: 4513353947107249193
physical_device_desc: "device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1"
]