无法在仅 tensorflow CPU 安装上加载动态库“cudart64_101.dll" [英] Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation

查看:62
本文介绍了无法在仅 tensorflow CPU 安装上加载动态库“cudart64_101.dll"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚通过 pip install tensorflow 安装了最新版本的 Tensorflow,每当我运行程序时,我都会收到日志消息:

I just installed the latest version of Tensorflow via pip install tensorflow and whenever I run a program, I get the log message:

W tensorflow/stream_executor/platform/default/dso_loader.cc:55] 无法加载动态库cudart64_101.dll";dlerror: cudart64_101.dll 未找到

W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found

这不好吗?如何修复错误?

Is this bad? How do I fix the error?

推荐答案

Tensorflow 2.1+

发生了什么事?

使用 新的 Tensorflow 2.1 版本,默认tensorflow pip 包包含 TF 的 CPU 和 GPU 版本.在以前的 TF 版本中,找不到 CUDA 库会发出错误并引发异常,而现在库会动态搜索正确的 CUDA 版本,如果找不到,则会发出警告(W开头代表警告,错误有一个E(或F表示致命错误)并回退到CPU-only模式.其实这也是在警告后立即作为信息消息写入日志(请注意,如果您的最低日志级别高于默认值,您可能看不到信息消息).完整日志是(强调我的):

Tensorflow 2.1+

What's going on?

With the new Tensorflow 2.1 release, the default tensorflow pip package contains both CPU and GPU versions of TF. In previous TF versions, not finding the CUDA libraries would emit an error and raise an exception, while now the library dynamically searches for the correct CUDA version and, if it doesn't find it, emits the warning (The W in the beginning stands for warnings, errors have an E (or F for fatal errors) and falls back to CPU-only mode. In fact, this is also written in the log as an info message right after the warning (do note that if you have a higher minimum log level that the default, you might not see info messages). The full log is (emphasis mine):

2020-01-20 12:27:44.554767: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] 无法加载动态库cudart64_101.dll";dlerror: cudart64_101.dll 未找到

2020-01-20 12:27:44.554767: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found

2020-01-20 12:27:44.554964: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] 如果您的机器上没有设置 GPU,请忽略上面的 cudart dlerror.

2020-01-20 12:27:44.554964: 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.

我应该担心吗?我该如何解决?

如果您的机器上没有支持 CUDA 的 GPU,或者如果您不在乎没有 GPU 加速,则无需担心.另一方面,如果您安装了 tensorflow 并想要 GPU 加速,请检查您的 CUDA 安装(TF 2.1 需要 CUDA 10.1不是 10.2 或 10.0).

Should I worry? How do I fix it?

If you don't have a CUDA-enabled GPU on your machine, or if you don't care about not having GPU acceleration, no need to worry. If, on the other hand, you installed tensorflow and wanted GPU acceleration, check your CUDA installation (TF 2.1 requires CUDA 10.1, not 10.2 or 10.0).

如果只是想去掉警告,可以调整TF的日志级别抑制警告,但这可能是矫枉过正,因为它会使所有警告静音.

If you just want to get rid of the warning, you can adapt TF's logging level to suppress warnings, but that might be overkill, as it will silence all warnings.

您的 CUDA 设置已损坏,请确保您安装了正确的版本.

Your CUDA setup is broken, ensure you have the correct version installed.

这篇关于无法在仅 tensorflow CPU 安装上加载动态库“cudart64_101.dll"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆