Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x TensorFlow导入错误:导入_pywrap_TensorFlow_internal时DLL加载失败:找不到指定的模块_Python 3.x_Tensorflow_Importerror_Dllimport_Tensorflow2.x - Fatal编程技术网

Python 3.x TensorFlow导入错误:导入_pywrap_TensorFlow_internal时DLL加载失败:找不到指定的模块

Python 3.x TensorFlow导入错误:导入_pywrap_TensorFlow_internal时DLL加载失败:找不到指定的模块,python-3.x,tensorflow,importerror,dllimport,tensorflow2.x,Python 3.x,Tensorflow,Importerror,Dllimport,Tensorflow2.x,系统规格: Python==3.8.5 tensorflow==2.3.1 我正在尝试导入tensorflow。。。但我得到了导入错误。请帮我纠正这个问题。我试着跟着 pip uninstall tensorflow 及 执行pip freeze时,我看到已安装的tensorflow软件包具有指定版本。 错误消息: ImportError Traceback (most recent call last) ~\anaconda3\

系统规格:

  • Python==3.8.5
  • tensorflow==2.3.1
我正在尝试导入tensorflow。。。但我得到了导入错误。请帮我纠正这个问题。我试着跟着

pip uninstall tensorflow

执行
pip freeze
时,我看到已安装的tensorflow软件包具有指定版本。
错误消息:

ImportError                               Traceback (most recent call last)
~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
     63   try:
---> 64     from tensorflow.python._pywrap_tensorflow_internal import *
     65   # This try catch logic is because there is no bazel equivalent for py_extension.

ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-1-d6579f534729> in <module>
----> 1 import tensorflow

~\anaconda3\lib\site-packages\tensorflow\__init__.py in <module>
     39 import sys as _sys
     40 
---> 41 from tensorflow.python.tools import module_util as _module_util
     42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
     43 

~\anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>
     38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
     39 
---> 40 from tensorflow.python.eager import context
     41 
     42 # pylint: enable=wildcard-import

~\anaconda3\lib\site-packages\tensorflow\python\eager\context.py in <module>
     33 from tensorflow.core.protobuf import config_pb2
     34 from tensorflow.core.protobuf import rewriter_config_pb2
---> 35 from tensorflow.python import pywrap_tfe
     36 from tensorflow.python import tf2
     37 from tensorflow.python.client import pywrap_tf_session

~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py in <module>
     26 
     27 # pylint: disable=invalid-import-order,g-bad-import-order, wildcard-import, unused-import
---> 28 from tensorflow.python import pywrap_tensorflow
     29 from tensorflow.python._pywrap_tfe import *

~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
     81 for some common reasons and solutions.  Include the entire stack trace
     82 above this error message when asking for help.""" % traceback.format_exc()
---> 83   raise ImportError(msg)
     84 
     85 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
  File "C:\Users\user\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 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
63尝试:
--->64从tensorflow.python.\u pywrap\u tensorflow\u内部导入*
65#这种try-catch逻辑是因为py#u扩展没有bazel等价物。
导入错误:导入_pywrap_tensorflow_internal时DLL加载失败:找不到指定的模块。
在处理上述异常期间,发生了另一个异常:
ImportError回溯(最近一次呼叫最后一次)
在里面
---->1输入张量流
~\anaconda3\lib\site packages\tensorflow\\uuuu init\uuuuuu.py in
39导入系统为_sys
40
--->41从tensorflow.python.tools将模块_util作为_模块_util导入
42从tensorflow.python.util.lazy_加载程序将LazyLoader作为_LazyLoader导入
43
~\anaconda3\lib\site packages\tensorflow\python\\uuuuu init\uuuuuuuu.py in
38#pylint:disable=通配符导入,g-bad-import-order,g-import-not-at-top
39
--->40来自tensorflow.python.eager导入上下文
41
42#pylint:enable=通配符导入
中的~\anaconda3\lib\site packages\tensorflow\python\eager\context.py
33来自tensorflow.core.protobuf导入配置\u pb2
34来自tensorflow.core.protobuf导入重写器\u config\u pb2
--->35从tensorflow.python导入pywrap\u tfe
36从tensorflow.python导入tf2
37从tensorflow.python.client导入pywrap\u tf\u会话
~\anaconda3\lib\site packages\tensorflow\python\pywrap\u tfe.py in
26
27#pylint:disable=无效的导入顺序、g-bad-import-order、通配符导入、未使用的导入
--->28从tensorflow.python导入pywrap\u tensorflow
29从tensorflow.python.\u pywrap\u tfe导入*
~\anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow.py in
81因为一些常见的原因和解决方案。包括整个堆栈跟踪
请求帮助时,请在上面显示此错误消息。“%traceback.format_exc()
--->83.恐怖主义(味精)
84
85#pylint:enable=通配符导入,g-import-not-at-top,未使用的导入,行太长
ImportError:回溯(最近一次呼叫上次):
文件“C:\Users\user\anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow.py”,第64行,在
从tensorflow.python.\u pywrap\u tensorflow\u内部导入*
导入错误:导入_pywrap_tensorflow_internal时DLL加载失败:找不到指定的模块。
未能加载本机TensorFlow运行时。
看见https://www.tensorflow.org/install/errors
由于一些常见的原因和解决方案。包括整个堆栈跟踪
以上是请求帮助时的错误消息```

使用Anaconda安装Tensorflow

使用Python 3.8为Tensorflow创建单独的环境

conda create --name tf python=3.8 tensorflow 
conda activate tf

使用Anaconda安装Tensorflow

使用Python 3.8为Tensorflow创建单独的环境

conda create --name tf python=3.8 tensorflow 
conda activate tf

谢谢:)它正在工作。但是我无法在jupyter笔记本打开的环境中的jupyter notebook Check中加载TF。如果它与TF环境不同,请在那里重新安装Tensorflow。谢谢谢谢:)它正在工作。但是我无法在jupyter笔记本打开的环境中的jupyter notebook Check中加载TF。如果与tf环境不同,在那里安装Tensorflow。谢谢