Python 导入错误:找不到“cudart64_100.dll”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/57528027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:40:32  来源:igfitidea点击:

ImportError: Could not find 'cudart64_100.dll

pythontensorflow

提问by Alex Zaitsev

I'm trying to install tensorflow-gpu==2.0.0-beta1on my Windows 10 machine and got this error:

我正在尝试tensorflow-gpu==2.0.0-beta1在我的 Windows 10 机器上安装并收到此错误:

ImportError: Could not find 'cudart64_100.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: https://developer.nvidia.com/cuda-90-download-archive

导入错误:找不到“cudart64_100.dll”。TensorFlow 要求将此 DLL 安装在 %PATH% 环境变量中命名的目录中。从此 URL 下载并安装 CUDA 10.0:https: //developer.nvidia.com/cuda-90-download-archive

I made all things from:

我做了所有的东西:

But error still occurs

但是还是会出现错误

How can I fix this?

我怎样才能解决这个问题?

回答by jjj

The simplest way to fix is to install the latest ‘NVIDIA GPU Computing Toolkit', because if it's not there, you'll be missing the 'cudart64_100.dll' library. The only issue is that the latest copy of CUDA has this particular library upgraded to 'cudart64_101.dll', while the latest TensorFlow still requires the older 'cudart64_100.dll'. Anyways, one way to deal with this issue is to install the latest CUDA + CUDA from September 2018 and then copy 'cudart64_100.dll' library from old install to the new one.

最简单的修复方法是安装最新的“NVIDIA GPU Computing Toolkit”,因为如果它不存在,您将缺少“cudart64_100.dll”库。唯一的问题是 CUDA 的最新副本将这个特定的库升级到“cudart64_101.dll”,而最新的 TensorFlow 仍然需要旧的“cudart64_100.dll”。无论如何,解决此问题的一种方法是从 2018 年 9 月开始安装最新的 CUDA + CUDA,然后将“cudart64_100.dll”库从旧安装复制到新安装。

Or just visit my site where I linked the 'cudart64_100.dll' library downloaded from the CUDA Toolkit 10.0 (Sept 2018), to make it easier to copy it into the latest CUDA directory.

或者只是访问我的网站,在那里我链接了从 CUDA Toolkit 10.0(2018 年 9 月)下载的“cudart64_100.dll”库,以便更轻松地将其复制到最新的 CUDA 目录中。

Here are some screenshots to illustrate the process: https://www.joe0.com/2019/10/19/how-resolve-tensorflow-2-0-error-could-not-load-dynamic-library-cudart64_100-dll-dlerror-cudart64_100-dll-not-found/

下面是一些截图来说明这个过程:https: //www.joe0.com/2019/10/19/how-resolve-tensorflow-2-0-error-could-not-load-dynamic-library-cudart64_100-dll -dlerror-cudart64_100-dll-not-found/

回答by munney

I have faced similar issue. I have added the directory of the cudart64_100.dll file to the PATH variable but still it prompts the error "cudart64_100.dll" not found. In the end I finally manage to make it work by adding the following codes. Hope it helps.

我遇到过类似的问题。我已将 cudart64_100.dll 文件的目录添加到 PATH 变量中,但仍提示未找到错误“cudart64_100.dll”。最后,我终于设法通过添加以下代码使其工作。希望能帮助到你。

import ctypes

hllDll = ctypes.WinDLL("C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\cudart64_100.dll")

回答by Cibi SL

I had similar error:

我有类似的错误:

cudart64_101.dll not found

cudart64_101.dll 未找到

It is because the latest version of CUDArequires older CUDA-version.dllfiles to work properly. The solution would be try installing the previous version of CUDA.

这是因为最新版本的CUDA需要旧CUDA-version.dll文件才能正常工作。解决方案是尝试安装以前版本的CUDA

Once you have downloaded CUDA 10.1run the .exefile which will first extract the necessary files in C:\Users\your_user_name\AppData\Local\Temp\CUDA.

下载CUDA 10.1 后,运行该.exe文件,该文件将首先以C:\Users\your_user_name\AppData\Local\Temp\CUDA.

Once the extraction is completed do not proceed with the installation navigate to the directory C:\Users\your_user_name\AppData\Local\Temp\CUDA\cudart\binand here you will find the missing DLLfile cudart64_101.dlland cudart32_101.dllcopy both the files to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\binand then cancel the installation.

一旦提取完成后不安装导航到该目录进行C:\Users\your_user_name\AppData\Local\Temp\CUDA\cudart\bin,在这里你会找到失踪的DLL文件cudart64_101.dllcudart32_101.dll文件复制既C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin然后取消安装。

Follow the same steps for any CUDAversion will work for sure. Hope this helps thank you!!!

对任何CUDA版本执行相同的步骤肯定会起作用。希望能帮到你谢谢!!!

回答by Joe

Just rename

只需重命名

\program files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\cudart64_102.dll 

to cudart100.dll

cudart100.dll

回答by Andi Schroff

I also was dealing with the current situation that tensorflow expects cudart64_101.dll and NVIDIA offers Version 10.2 as main version (including cudart64_102.dll).

我还处理了当前 tensorflow 期望 cudart64_101.dll 和 NVIDIA 提供版本 10.2 作为主要版本(包括 cudart64_102.dll)的情况。

I simply installed both versions. I have both versions in the windows path. Beside disc space, I did not have problems so far and GPU is used in tensorflow.

我只是安装了两个版本。我在 Windows 路径中有两个版本。除了磁盘空间,到目前为止我没有遇到任何问题,并且在 tensorflow 中使用了 GPU。