【问题标题】:Tensorflow 1.13.1 doesn't recognize GPUTensorflow 1.13.1 无法识别 GPU
【发布时间】:2023-03-12 09:20:02
【问题描述】:

我安装了 GPU NVIDIA GeForce GT 740M(计算能力 3.0)和以下版本的 CUDA、cuDNN 和 tensorflow。

nvcc -V

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:17_PST_2019
Cuda compilation tools, release 10.1, V10.1.105

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

#define CUDNN_MAJOR 7
#define CUDNN_MINOR 5
#define CUDNN_PATCHLEVEL 0
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)

#include "driver_types.h"

pip3 显示 tensorflow-gpu

Name: tensorflow-gpu
Version: 1.13.1
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /home/lightning/.local/lib/python3.6/site-packages
Requires: grpcio, tensorboard, absl-py, termcolor, protobuf, astor, gast, numpy, tensorflow-estimator, wheel, keras-preprocessing, keras-applications, six

pip3 显示张量流

Name: tensorflow
Version: 1.13.1
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /home/lightning/.local/lib/python3.6/site-packages
Requires: wheel, keras-preprocessing, numpy, astor, six, protobuf, tensorflow-estimator, termcolor, grpcio, keras-applications, absl-py, tensorboard, gast

但是当我用print(device_lib.list_local_devices())检查tensorflow检测到的设备时,输出如下...

[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 13567978771733496471
, name: "/device:XLA_CPU:0"
device_type: "XLA_CPU"
memory_limit: 17179869184
locality {
}
incarnation: 12191851301991039336
physical_device_desc: "device: XLA_CPU device"
]

如何让 tensorflow 看到 GPU?

附言tensorflow-gpu 是在 tensorflow 之前安装的,所以按照“1) tensorflow-gpu 2) tensorflow”的顺序重新安装效率低下

【问题讨论】:

  • 虽然包名不同,但是模块名是一样的。因此,tensorflow 安装会覆盖 tensorflow-gpu 实现。只有 tensorflow-gpu 就足够了。请卸载张量流。点卸载张量流。 pip install tensorflow-gpu
  • @ManojMohan 当我这样做时,我无法导入基于它的 tensorflow 和库。出现错误(字符限制不允许复制整个文本),文本如下:============================ ============ ImportError: Traceback (most recent call last): ... ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory 无法加载原生 TensorFlow运行。有关一些常见原因和解决方案,请参阅 tensorflow.org/install/errors。寻求帮助时,请在此错误消息上方包含整个堆栈跟踪。
  • 您拥有 CUDA 10.1。如错误所示,安装 CUDA 10。developer.nvidia.com/cuda-10.0-download-archive

标签: tensorflow gpu cudnn


【解决方案1】:

tensorflow 需要计算能力 +3.2。

你有一个具有计算能力 3.0 的 GPU

【讨论】:

    猜你喜欢
    • 2020-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多