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

查看:1417
本文介绍了无法在仅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模式.实际上,这也是警告后立即在日志中写为信息消息(请注意,如果最低日志级别高于默认日志级别,则可能看不到信息消息.)完整日志为(强调我):

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:我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天全站免登陆