简体   繁体   中英

Installing and Using Tensorflow GPU

I have tried multiple resources on installing tensorflow-gpu. I have a graphic card of GeForce GTX 1060 3GB. I installed both CUDA and CuDNN 10.0 and set the path according to the guide. However, I cannot use the tensorflow-gpu. Whenever I tried to check whether it has gpu or not, it gives me an error. Is there anyone of you have the best resources that you guys have followed or any advice?

#1st way of checking
>>> import tensorflow as tf
>>> tf.Session()
2019-11-22 18:29:44.166767: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
<tensorflow.python.client.session.Session object at 0x000002855CF70888>

#2nd way of checking    
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 3258227305323620158
]

I followed the offical install guide at https://www.tensorflow.org/install/pip

You may need to uninstall any existing tensorflow (CPU) packages before you install tensorflow-gpu

Try rebooting if you haven't already and see if that fixes anything.

To uninstall tensorflow (CPU) run:

pip uninstall tensorflow

If using pip3:

pip3 uninstall tensorflow

Then to install tensorflow-gpu:

pip install tensorflow-gpu

pip3:

pip3 install tensorflow-gpu

I've seen people uninstall protobuf before they uninstall tensorflow so you could also give that a shot by running:

pip uninstall protobuf

pip3:

pip3 uninstall protobuf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM