我已经使用Anaconda Navigator安装了tensorflow
包。当我尝试在jupyter笔记本中运行import tensorflow
时,我得到以下错误:
OSError Traceback (most recent call last)
D:\ProgrammFiles\Anaconda\lib\site-packages\tensorflow\python\platform\self_check.py in preload_check()
61 try:
---> 62 ctypes.WinDLL(build_info.nvcuda_dll_name)
63 except OSError:
D:\ProgrammFiles\Anaconda\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
363 if handle is None:
--> 364 self._handle = _dlopen(self._name, mode)
365 else:
OSError: [WinError 126] Det går inte att hitta den angivna modulen
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-8-d6579f534729> in <module>
----> 1 import tensorflow
D:\ProgrammFiles\Anaconda\lib\site-packages\tensorflow\__init__.py in <module>
26
27 # pylint: disable=g-bad-import-order
---> 28 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
29 from tensorflow.python.tools import module_util as _module_util
30
D:\ProgrammFiles\Anaconda\lib\site-packages\tensorflow\python\__init__.py in <module>
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers
D:\ProgrammFiles\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
28 # Perform pre-load sanity checks in order to produce a more actionable error
29 # than we get from an error during SWIG import.
---> 30 self_check.preload_check()
31
32 # pylint: disable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
D:\ProgrammFiles\Anaconda\lib\site-packages\tensorflow\python\platform\self_check.py in preload_check()
68 "'C:\\Windows\\System32'. If it is not present, ensure that you "
69 "have a CUDA-capable GPU with the correct driver installed."
---> 70 % build_info.nvcuda_dll_name)
71
72 if hasattr(build_info, "cudart_dll_name") and hasattr(
ImportError: Could not find 'nvcuda.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Typically it is installed in 'C:\Windows\System32'. If it is not present, ensure that you have a CUDA-capable GPU with the correct driver installed.
我知道我不能使用tensorflow-gpu
,因为我没有NVIDIA GPU。因此,我甚至没有安装tensorflow-gpu
包
在没有安装CUDA的情况下,如何导入TensorFlow
正如评论中所讨论的,问题只出现在您的安装中。使用anaconda navigator不是安装
tensorflow
的最佳方式。我的假设是tensorflow-base
或tensorflow-estimate
具有GPU依赖性,这就是它一直显示发布的错误消息的原因使用
conda
安装tensorflow
的最佳方式是通过conda-forge
通道,这是官方方式。您可以通过运行以下命令来完成此操作:相关问题 更多 >
编程相关推荐