tensorflow 安装: could no t load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll

Posted montai

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tensorflow 安装: could no t load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll相关的知识,希望对你有一定的参考价值。

TensorFlow 是一个端到端开源机器学习平台

安装

pip3  install tensorflow

使用时报错如下

技术图片
2020-06-03 09:42:51.737502: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could no
t load dynamic library ‘cudart64_101.dll‘; dlerror: cudart64_101.dll not found
2020-06-03 09:42:51.737502: 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.
2020-06-03 09:42:53.392597: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x167fbc50
initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-06-03 09:42:53.392597: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor devic
e (0): Host, Default Version
2020-06-03 09:42:53.395597: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successf
ully opened dynamic library nvcuda.dll
2020-06-03 09:42:53.472601: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0
with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 670 computeCapability: 3.0
技术图片

没有 cuDNN64_7.dll 文件,TensorFlow 将无法加载

Windows上搭建TensorFlow的开发环境

需要至少需要安装:

  1.python

  2.CUDA和CuDNN

  CUDA 是NVIDIA发明了一种并行计算平台和编程模型。通过利用图形处理单元(GPU)的功能,可以显着提高计算性能

  CUDA下载地址:https://developer.nvidia.com/cuda-90-download-archive

下载后安装

配置环境变量

SET PATH=C:Program FilesNVIDIA GPU Computing ToolkitCUDAv10.1in;%PATH%
SET PATH=C:Program FilesNVIDIA GPU Computing ToolkitCUDAv10.1extrasCUPTIlibx64;%PATH%
SET PATH=C:Program FilesNVIDIA GPU Computing ToolkitCUDAv10.1include;%PATH%

查看是否安装成功

nvcc -V

技术图片

     NVIDIA cuDNN是用于深度神经网络的GPU加速的原语库

  CuDNN下载地址:https://developer.nvidia.com/cudnn

下载后解压

配置环境变量

SET PATH=C:Program Filescudain;%PATH%

查看自己的GPU,配置环境变量

SET PATH=C:Program FilesNVIDIA CorporationNVSMI;%PATH%

查看命令

nvidia-smi

技术图片

  3.TensorFlow(GPU版)

安装前一定要确认好每个软件的版本是否相互支持

Bazel 是用于编译 TensorFlow 的构建工具

  将 Bazel 可执行文件的位置添加到 %PATH% 环境变量中

  下载地址:https://github.com/bazelbuild/bazel/releases

先 查看tensorflow版本信息,根据版本对应不同版本的软件

eg:

  tensorflow2.2.0

  Python 3.7.7

以上是关于tensorflow 安装: could no t load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll的主要内容,如果未能解决你的问题,请参考以下文章

彻底解决tensorflow:ImportError: Could not find 'cudart64_90.dll' tensorflow安装

Windows下 Tensorflow安装问题: Could not find a version that satisfies the requirement tensorflow

anaconda安装tensorflow问题: Could not find a version that satisfies the requirement tensorboard

Windows下Pycharm安装Tensorflow:ERROR: Could not find a version that satisfies the requirement tensorflo

pip 安装TensorFlow Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。:

安装tensorflow后报错Could not load dynamic library ‘cudart64_110.dll‘; dlerror:cudart64_110.dll not found