tensorflow - 安装 tensorflow 1.8.0 gpu
问题描述
我正在按照https://www.tensorflow.org/install/install_windows上的说明使用 pip 安装 tensorflow gpu
pip3 install --upgrade tensorflow-gpu
这似乎工作并表明已安装版本 1.8.0。
唯一的警告是关于 pip 不是最新的,建议我使用以下命令更新 pip:
python -m pip install --upgrade pip
同样没有错误报告。
我尝试了 hello 这个词(或者到目前为止只有第一行:
>>> import tensorflow as tf
我收到一条很长的错误消息:
Traceback (most recent call last):
File "C:\Users\Me\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
ctypes.WinDLL(build_info.cudart_dll_name)
File "C:\Users\Me\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Me\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Me\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Me\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\Me\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
% (build_info.cudart_dll_name, build_info.cuda_version_number))
ImportError: Could not find 'cudart64_90.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 9.0 from this URL: https://developer.nvidia.com/cuda-toolkit
我安装了 Cuda 9.1,因为其他软件包需要该版本。虽然说明页面指示 Cuda 9.0,但说明页面上的链接链接到 nvidia 网站上的 Cuda 9.1。
所以问题是有没有办法安装 cuda 9.1,或者我应该等到另一个版本可用。在浏览其他类似问题时,似乎有一段时间它是为 tensorflow 1.5 设计的。
有什么建议吗?
解决方案
在那里找到了答案:https ://www.codingforentrepreneurs.com/blog/install-tensorflow-gpu-windows-cuda-cudnn/
我唯一不同的是没有安装 CUDA 9.0 的驱动程序(仅 CUDA 部分)。
推荐阅读
- html - 设置 div 以填充页面并使其在附加时也保持该高度
- closures - Tcl:惯用的[关闭]
- python-3.x - 辅音卡在猪拉丁语中
- reactive-programming - 如何在反应式编程中创建计数器映射?
- google-sheets - 将多列数据转换为三元组的行,其类型列的值基于原始列名
- python - random.choice 在计算其参数时存在问题
- excel - VBA 将文本列转换为 ASCII 值
- python - 了解 Python 函数
- autoit - 如何处理记录用户活动的 AutoIt 脚本的输出?
- ajax - 如何在 VueJS 中向 Axios 调用添加标头?