简体   繁体   English

tensorflow,tensorflow-gpu 无法识别 GPU

[英]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.我有 tensorflow 1.14.0 和 tensorflow-gpu 1.14.0 我已经安装了所需的兼容 Cuda 和 Cudnn 版本,并在环境变量中指定了它们的路径。 but still the tensorflow and/or tensorflow-gpu, don't recognize my GPU.但仍然是 tensorflow 和/或 tensorflow-gpu,无法识别我的 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操作:Windows 10

IDE: Jupyter (anaconda) IDE:Jupyter(蟒蛇)

GPU version: GTX 960M GPU版本: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...注意:有些帖子提到你必须在最后卸载 tensorflow,但是当我这样做时,上面的代码甚至不起作用......

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.您绝对应该从系统中卸载 tensorflow,在该步骤之后代码不起作用表明您的 tensorflow-gpu 安装存在一些问题。 This accepted answer suggests uninstalling tensorflow via pycharms and installing via pip.这个接受的答案建议通过 pycharms 卸载 tensorflow 并通过 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.此外,如果您有机会,请尝试升级到 tensorflow >= 2.0,急切执行非常好,并且肯定会支付获得新驱动程序和兼容 Cuda 和 Cudnn 版本的麻烦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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