繁体   English   中英

我在 Windows 10 中运行 Tensorflow-gpu 时遇到问题

[英]I'm having trouble running Tensorflow-gpu in my Windows 10

我有一个 GTX 1650 和一个 Windows 10。我为 CUDA 10.1 下载了 CUDA 10.1 和 cuDNN v7.6.4(2019 年 9 月 27 日)。 遵循教程后,我按照教程中的说明做了。

完成后,我运行了一个脚本来检查:

from tensorflow.python.client import device_lib

print(device_lib.list_local_devices())

我收到以下错误:

回溯(最近一次调用):文件“C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\tensorflow_core\\python\\pywrap_tensorflow.py”,第 58 行,来自 tensorflow.python.pywrap_tensorflow_internal import *文件“C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\tensorflow_core\\python\\pywrap_tensorflow_internal.py”,第 28 行,在 _pywrap_tensorflow_internal = swig_import_helper() 文件“C:\\Users\\prono\\Anaconda3\\ envs\\tensorflow\\lib\\site-packages\\tensorflow_core\\python\\pywrap_tensorflow_internal.py”,第 24 行,在 swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) 文件“C:\\Users\\prono\\Anaconda3 \\envs\\tensorflow\\lib\\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\imp.py", line 343 , 在 load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found.

在处理上述异常的过程中,又发生了一个异常:

回溯(最近一次调用):文件“pypy.py”,第 1 行,来自 tensorflow.python.client 导入 device_lib 文件“C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\tensorflow__init__。 py”,第 101 行,来自 tensorflow_core import * 文件“C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\tensorflow_core__init__.py”,第 40 行,来自 tensorflow.python.tools import module_util as _module_util File "C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\tensorflow__init__.py", line 50, in getattr module = self._load() File "C:\\Users\\prono\\Anaconda3\\ ENVS \\ tensorflow \\ lib中\\站点包\\ tensorflow__init __ PY “第44行,在_load模块= _importlib.import_module(个体名称。)文件” C:\\ Users \\用户普罗诺\\ Anaconda3 \\ ENVS \\ tensorflow \\ lib中\\ importlib__init __ PY ", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\tensorflow_core\\python__init__.py",第 49 行,从 tensorflow.python 导入 pywrap_tensorflow 文件“C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\tensorflow_core\\python\\pywrap_tensorflow.py”,第 74 行,在 raise ImportError(msg) ImportError: Traceback(最近一次调用最后一次)中:文件“C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\tensorflow_core\\python\\pywrap_tensorflow.py”,第 58 行,来自 tensorflow.python.pywrap_tensorflow_internal import * 文件“C:\\Users\\prono \\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\tensorflow_core\\python\\pywrap_tensorflow_internal.py”,第 28 行,在 _pywrap_tensorflow_internal = swig_import_helper() 文件“C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\site- packages\\tensorflow_core\\python\\pywrap_tensorflow_internal.py”,第 24 行,在 swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) 文件“C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\imp .py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\\Users\\prono\\Anaconda3\\envs\\tensorflow\\lib\\imp.py", lin e 343, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found.

无法加载本机 TensorFlow 运行时。

请参阅https://www.tensorflow.org/install/errors

出于一些常见的原因和解决方案。 寻求帮助时,请在此错误消息上方包含整个堆栈跟踪。

PS 这是我第一次发帖提问,如果我把帖子说的不清楚,请见谅。 我只是不知道还要添加什么

对于 Windows 10:

https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html

对于 ubuntu 18.04,请查看我的 cuda 安装手册:

https://gist.github.com/sailfish009/2f542992a67da726f41dcc9692da3f56

——

https://github.com/tensorflow/tensorflow/issues/22794

我在 Windows 10 上尝试使用 tensorflow-gpu 时遇到了同样的问题。因为我无法让它在 cuDNN10 上工作......我选择了 9 而不是使用......

 conda create --name tf-gpu conda install -c aaronzs tensorflow-gpu conda install -c anaconda cudatoolkit conda install -c anaconda cudnn conda install keras-gpu

您还可以在https://www.pugetsystems.com/labs/hpc/The-Best-Way-to-Install-TensorFlow-with-GPU-Support-on-Windows-10-Without-Installing-CUDA上查看全文-1187/

归功于唐纳德·金霍恩博士

暂无
暂无

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

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