How to use TensorFlow GPU version instead of CPU version in Python 3.6 x64?
import tensorflow as tf
Python is using my CPU for calculations.
I can notice it because I have an error:
Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
I have installed tensorflow and tensorflow-gpu.
How to switch to GPU version?
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
iacolippo 2018-07-12 13:29
Follow this tutorial Tensorflow GPU I did it and it works perfect.
Attention! - install version 9.0! newer version is not supported by Tensorflow-gpu
Steps:
pip install tensorflow-gpu
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
I tried following the above tutorial. Thing is tensorflow changes a lot and so do the NVIDIA versions needed for running on a GPU. The next issue is that your driver version determines your toolkit version etc. As of today this information about the software requirements should shed some light on how they interplay:
NVIDIA® GPU drivers —CUDA 9.0 requires 384.x or higher.
CUDA® Toolkit —TensorFlow supports CUDA 9.0.
CUPTI ships with the CUDA Toolkit.
cuDNN SDK (>= 7.2) Note: Make sure your GPU has compute compatibility >3.0
(Optional) NCCL 2.2 for multiple GPU support.
(Optional) TensorRT 4.0 to improve latency and throughput for inference on some models.
And here you'll find the up-to-date requirements stated by tensorflow (which will hopefully be updated by them on a regular basis).
tensorflow
and just keep thetensorflow-gpu
installed - Jorge Leitão 2018-07-12 13:27