我正按照https://www.tensorflow.org/install/install_windows
上的说明使用pip安装tensorflow gpupip3 install --upgrade tensorflow-gpu
这似乎有效并且表明已安装版本1.8.0。
唯一的警告是关于pip不是最新的,因为我建议用以下命令更新pip:
python -m pip install --upgrade pip
同样没有报告错误。
我尝试了你好的话(或者到目前为止只有第一行:
>>> 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安装,或者我应该等到另一个版本可用。在浏览其他类似的问题时,似乎有一段时间它被计划为张量流1.5。
有什么建议吗?
答案 0 :(得分:0)
在那里找到答案:https://www.codingforentrepreneurs.com/blog/install-tensorflow-gpu-windows-cuda-cudnn/
我唯一不同的做法是不安装CUDA 9.0的驱动程序(只有CUDA部分)。