简体   繁体   中英

tensorflow, tensorflow-gpu not recognizing the GPU

this might be a repeated post but none of the other posts worked for me. i have tensorflow 1.14.0 and tensorflow-gpu 1.14.0 i have already installed the compatible Cuda and Cudnn versions required, and specified their path in environment variables. but still the tensorflow and/or tensorflow-gpu, don't recognize my GPU. so the of the validating code:

from tensorflow.python.client import device_lib
def get_available_devices():
    local_device_protos = device_lib.list_local_devices()
    return [x.name for x in local_device_protos]

print(get_available_devices()) 

is:

['/device:CPU:0']

OP: windows 10

IDE: Jupyter (anaconda)

GPU version: GTX 960M

note: some posts mention that you have to uninstall tensorflow at the end, but when i do, the code above doesn't even work...

You should definitely uninstall tensorflow from your system, the code not working after that step is a sign your tensorflow-gpu installation has some problems. This accepted answer suggests uninstalling tensorflow via pycharms and installing via pip.

Also if you have the opportunity, try to upgrade to tensorflow >= 2.0, the eager execution is very nice and surely pays up the hassle of getting the new drivers and compatibles Cuda and Cudnn versions.

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