繁体   English   中英

如何配置我的 jupyter 笔记本,使其在使用 keras 时使用可用的 GPU?

[英]How do I configure my jupyter notebook so that it uses the available GPU while working with keras?

我搜索了解决方案并使用 pip 安装了 tensorflow-gpu。

tf.config.list_physical_devices('GPU')

此代码返回一个空列表。 []

您可以看到我有 2 个 GPU,但是当我使用 keras 进行图像处理 (CNN) 时,它们都没有被使用。

我是新手,所以不明白到底出了什么问题。 请帮我配置,以便我可以使用我的 GPU 进行处理。 我正在使用 Windows 10 64 位 Python-3.8.7。 按照建议,我尝试在 python 终端上导入 tensorflow,并得到以下错误:

import tensorflow as tf

2021-02-13 22:52:17.253841:W tensorflow/stream_executor/platform/default/dso_loader.cc:60] 无法加载动态库“cudart64_110.dll”; dlerror: cudart64_110.dll not found 2021-02-13 22:52:17.266384: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

当我尝试列出 GPU 时,紧随其后的是: tf.config.list_physical_devices('GPU')

2021-02-13 22:57:17.390319:我 tensorflow/compiler/jit/xla_cpu_device.cc:41] 未创建 XLA 设备,未设置 tf_xla_enable_xla_devices 2021-02-13 22:57:17.749790:我 tensorflow/stream_executor/platform/ default/dso_loader.cc:49] 成功打开动态库 nvcuda.dll 2021-02-13 22:57:18.937838: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] 找到设备 0,属性:pciBusID: 0000 :01:00.0 名称: GeForce MX150计算能力:6.1 coreClock:1.5315GHz coreCount:3 deviceMemorySize:2.00GiB deviceMemoryBandwidth:44.76GiB/s 2021-02-13 22:57:18.966071:W tensorflow/stream_executor/platform/default/dso_loader。 cc:60] 无法加载动态库“cudart64_110.dll”; dlerror: cudart64_110.dll 未找到 2021-02-13 22:57:18.974209: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] 无法加载动态库 'cublas64_11.dll'; dlerror: cublas64_11.dll 未找到 2021-02-13 22:57:18.981154: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] 无法加载动态库 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll 未找到 2021-02-13 22:57:18.988826: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] 无法加载动态库 'cufft64_10.dll'; dlerror: cufft64_10.dll 未找到 2021-02-13 22:57:18.996411: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] 无法加载动态库 'curand64_10.dll'; dlerror: curand64_10.dll not found 2021-02-13 22:57:19.002563: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] 无法加载动态库 'cusolver64_10.dll'; dlerror: cusolver64_10.dll 未找到 2021-02-13 22:57:19.009636: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] 无法加载动态库 'cusparse64_11.dll'; dlerror: cusparse64_11.dll 未找到 2021-02-13 22:57:19.018025: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] 无法加载动态库“cudnn64_8.dll”; dlerror: cudnn64_8.dll 未找到 2021-02-13 22:57:19.025064: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1757] 无法打开一些 Z52F9EC21375243AD32Z97777 库。 如果您想使用 GPU,请确保正确安装了上述缺少的库。 按照https://www.tensorflow.org/install/gpu上的指南,了解如何为您的平台下载和设置所需的库。 跳过注册 GPU 设备... []

Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found此错误消息说 Tensorflow-gpu 需要 CUDA 11

Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found此错误消息表明运行 Tensorflow-gpu 版本需要 cuDNN 8。

安装正确的版本CUDAcuDNN并按照此处提到的说明在 Windows 操作系统上设置 GPU 支持。

暂无
暂无

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

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