【问题标题】:Not showing GPU, Installed tensroflow using anaconda不显示 GPU,使用 anaconda 安装 tensorflow
【发布时间】:2021-04-18 15:30:50
【问题描述】:

我使用下面安装了 tensorflow

conda create -n gpu_env tensorflow-gpu
conda activate gpu_env

并尝试使用以下代码检查 gpu:

from tensorflow.python.client import device_lib
device_lib.list_local_devices()

输出只显示 cpu。

2021-04-18 20:54:47.012684: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 9318913720310627740
]

我该怎么办?

【问题讨论】:

    标签: tensorflow anaconda gpu


    【解决方案1】:

    请注意,tensorflow-gpu 安装 tensorflow v2.3.0,目前,它不安装 conda cudnn 或 cudatoolkit 包。您可以做的一件事是安装早期版本的tensorflow,它会安装cudnncudatoolkit,然后使用pip 升级。

    conda install tensorflow-gpu=2.1
    pip install tensorflow-gpu==2.3.1
    

    在安装 tensorflow-gpu 期间,Anaconda 在 Windows 10 上自动选择的 tensorflow 构建似乎有问题,因此请检查此解决方法。

    【讨论】:

    • 嗨,Saurav,非常感谢。我一直在寻找这个将近 3 周。毫不夸张。您建议的解决方法很有效。
    • @CanerBurcBASKAYA 乐于助人:)
    猜你喜欢
    • 1970-01-01
    • 2021-06-05
    • 2017-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多