繁体   English   中英

导入时出错 Tensorflow - 无法加载本机 TensorFlow 运行时

[英]Error when importing Tensorflow - Failed to load the native TensorFlow runtime

这是完整的错误:

Traceback (most recent call last):


File "C:\Users\richa\Documents\_Projects_\Astr0loger\interface.py", line 26, in <module>
    from controller import choose_best_stocks
  File "C:\Users\richa\Documents\_Projects_\Astr0loger\controller.py", line 10, in <module>
    from trainer import get_data, train_model, test_model
  File "C:\Users\richa\Documents\_Projects_\Astr0loger\trainer.py", line 12, in <module>
    import tensorflow as tf
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\__init__.py", line 40, in <module>
    from tensorflow.python.eager import context
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\eager\context.py", line 35, in <module>
    from tensorflow.python import pywrap_tfe
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
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.

显然,问题的三个常见原因/修复方法是:

  1. Python 是 32 位,而系统是 64 位,反之亦然。 我查了一下,不是这样的。
  2. cpu 不支持 AVX2 指令 - 我试过 tensorflow-gpu,同样的问题,所以我不认为是这样
  3. 您需要安装 MSVC 2019 可再发行版 - 我检查过,我有

AAAAAAAAAAH 我该怎么办?

好吧,结果是通过安装旧版本的 Tensorflow 修复了错误; 2.0.0。 如果您遇到同样的问题,请尝试 tensorflow 的多个版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM