Python tensorflow安装有什么问题?我已经安装了tensorflow的gpu版本
昨天我安装了tensorflow的一个版本。它安装得很好,没有任何错误。我的笔记本电脑中还安装了NVIDIA geforcr 1050 ti图形卡Python tensorflow安装有什么问题?我已经安装了tensorflow的gpu版本,python,tensorflow,import,anaconda,jupyter-notebook,Python,Tensorflow,Import,Anaconda,Jupyter Notebook,昨天我安装了tensorflow的一个版本。它安装得很好,没有任何错误。我的笔记本电脑中还安装了NVIDIA geforcr 1050 ti图形卡 import tensorflow as tf 我的错误就在下面。有人请帮忙。我已经通过anaconda提示符通过命令pip install tensorflow gpu安装了它 --------------------------------------------------------------------------- ImportErr
import tensorflow as tf
我的错误就在下面。有人请帮忙。我已经通过anaconda提示符通过命令pip install tensorflow gpu
安装了它
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in
<module>()
57
---> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59 from tensorflow.python.pywrap_tensorflow_internal import
__version__
~\Anaconda3\lib\site-
packages\tensorflow\python\pywrap_tensorflow_internal.py in <module>()
27 return _mod
---> 28 _pywrap_tensorflow_internal = swig_import_helper()
29 del swig_import_helper
~\Anaconda3\lib\site-
packages\tensorflow\python\pywrap_tensorflow_internal.py in
swig_import_helper()
23 try:
---> 24 _mod =
imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
25 finally:
~\Anaconda3\lib\imp.py in load_module(name, file, filename, details)
242 else:
--> 243 return load_dynamic(name, filename, file)
244 elif type_ == PKG_DIRECTORY:
~\Anaconda3\lib\imp.py in load_dynamic(name, path, file)
342 name=name, loader=loader, origin=path)
--> 343 return _load(spec)
344
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-3-d6579f534729> in <module>()
----> 1 import tensorflow
~\Anaconda3\lib\site-packages\tensorflow\__init__.py in <module>()
22
23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow # pylint:
disable=unused-import
25
26 try:
~\Anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>()
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 from tensorflow.python.tools import component_api_helper
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
72 for some common reasons and solutions. Include the entire stack trace
73 above this error message when asking for help.""" % traceback.format_exc()
---> 74 raise ImportEr
ror(msg)
75
76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last):
File "C:\Users\Aditya Shrivastava\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Aditya Shrivastava\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Aditya Shrivastava\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\Aditya Shrivastava\Anaconda3\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Aditya Shrivastava\Anaconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
---------------------------------------------------------------------------
ImportError回溯(最近一次呼叫最后一次)
~\Anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow.py in
()
57
--->58来自tensorflow.python.pywrap\u tensorflow\u内部导入*
59来自tensorflow.python.pywrap\u tensorflow\u内部导入
__版本__
~\Anaconda3\lib\site-
在()中打包\tensorflow\python\pywrap\u tensorflow\u internal.py
27返回模式
--->28_pywrap_tensorflow_internal=swig_import_helper()
29 del swig_导入帮助程序
~\Anaconda3\lib\site-
中的packages\tensorflow\python\pywrap\u tensorflow\u internal.py
swig_import_helper()
23尝试:
--->24 _mod=
imp.load_模块(“pywrap_tensorflow_internal”,fp,路径名,描述)
25最后:
加载模块中的~\Anaconda3\lib\imp.py(名称、文件、文件名、详细信息)
242其他:
-->243返回加载动态(名称、文件名、文件)
244 elif类型=PKG\u目录:
动态加载中的~\Anaconda3\lib\imp.py(名称、路径、文件)
342名称=名称,加载器=加载器,原点=路径)
-->343返回荷载(规范)
344
ImportError:DLL加载失败:找不到指定的模块。
在处理上述异常期间,发生了另一个异常:
ImportError回溯(最近一次呼叫最后一次)
在()
---->1输入张量流
()
22
23#pylint:disable=g-bad-import-order
--->24从tensorflow.python导入pywrap_tensorflow#pylint:
禁用=未使用的导入
25
26尝试:
()
47作为np的进口numpy
48
--->49从tensorflow.python导入pywrap\u tensorflow
50
51从tensorflow.python.tools导入组件\u api\u助手
~\Anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow.py in()
72.一些常见的原因和解决方案。包括整个堆栈跟踪
73在请求帮助时显示此错误消息。“%traceback.format_exc()
--->74提高进口商
ror(味精)
75
76#pylint:enable=通配符导入,g-import-not-at-top,未使用的导入,行太长
ImportError:回溯(最近一次呼叫上次):
文件“C:\Users\Aditya Shrivastava\Anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow.py”,第58行,在
从tensorflow.python.pywrap\u tensorflow\u内部导入*
文件“C:\Users\Aditya Shrivastava\Anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow\u internal.py”,第28行,在
_pywrap\u tensorflow\u internal=swig\u import\u helper()
文件“C:\Users\Aditya Shrivastava\Anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow\u internal.py”,第24行,在swig\u import\u helper中
_mod=imp.load_模块(“pywrap_tensorflow_internal”,fp,路径名,描述)
文件“C:\Users\Aditya Shrivastava\Anaconda3\lib\imp.py”,第243行,在加载模块中
返回加载动态(名称、文件名、文件)
文件“C:\Users\Aditya Shrivastava\Anaconda3\lib\imp.py”,第343行,在load\u dynamic中
返回负载(规格)
ImportError:DLL加载失败:找不到指定的模块。
未能加载本机TensorFlow运行时。
看见https://www.tensorflow.org/install/errors
由于一些常见的原因和解决方案。包括整个堆栈跟踪
以上是请求帮助时的错误消息。
我基本上收到了如下导入错误:导入错误:DLL加载失败:找不到指定的模块。由于您在anconda版本中工作,您应该使用conda来安装软件包,而不是pip 因此,您应该使用
conda install tensorflow
,而不是pip3 install tensorflow
。这应该正确安装tensorflow
如果你仍然有问题,它可能与你的CUDA版本有关。据我所知,tf目前支持CUDA 9和CUDA 10,但要使用CUDA 10,你需要从源代码构建tf。因此你可以降级到CUDA 9,或者从源代码编译。从源代码编译的说明可能太复杂,无法深入讨论,但其他人已经这样做了我写过