【问题标题】:Failed to load the native TensorFlow runtime - DLL load failed未能加载原生 TensorFlow 运行时 - DLL 加载失败
【发布时间】:2021-01-07 19:40:14
【问题描述】:

不知道如何处理:

  • DLL 加载失败:Det går inte att hitta den angivna modulen(瑞典语:找不到所需的模块)
  • 未能加载原生 TensorFlow 运行时。

目前我无法用 tensorflow 做任何事情。

(spyder-env2) PS C:\> python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

TRACEBACK:

Traceback (most recent call last):
  File "C:\Users\eid\AppData\Local\Continuum\anaconda2\envs\tensorflow36\envs\spyder-env2\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: Det går inte att hitta den angivna modulen.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\eid\AppData\Local\Continuum\anaconda2\envs\tensorflow36\envs\spyder-env2\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\eid\AppData\Local\Continuum\anaconda2\envs\tensorflow36\envs\spyder-
env2\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
    from tensorflow.python.eager import context
  File "C:\Users\eid\AppData\Local\Continuum\anaconda2\envs\tensorflow36\envs\spyder-env2\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
    from tensorflow.python import pywrap_tfe
  File "C:\Users\eid\AppData\Local\Continuum\anaconda2\envs\tensorflow36\envs\spyder-env2\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\eid\AppData\Local\Continuum\anaconda2\envs\tensorflow36\envs\spyder-env2\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\eid\AppData\Local\Continuum\anaconda2\envs\tensorflow36\envs\spyder-env2\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: Det går inte att hitta den angivna modulen.


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.

【问题讨论】:

  • 来自您的错误:“请参阅 tensorflow.org/install/errors 了解一些常见原因和解决方案。在寻求帮助时,请在此错误消息上方包含整个堆栈跟踪。”这是你做的吗?

标签: python python-3.x tensorflow anaconda spyder


【解决方案1】:

此问题可能是因为 Tensorflow 需要 MSVC 2019 可再发行版或您的 CPU 不支持 AVX2 指令或您的 CPU/Python 为 32 位。

有一种解决方法,要么您必须从源代码构建 Tensorflow,要么使用 google colaboratory 工作。 使用here 中提到的指令从源代码编译。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-24
    • 2018-03-25
    • 2019-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多