TensorFlow DLL 加载失败:找不到指定的模块

TensorFlow DLL load failed: The specified module could not be found

正在终端中尝试 运行 python,已经完成:

 (base) C:\Users\Yinqi\trRosetta2\trRosetta>conda create -n tf tensorflow

但是运行进入这个错误:

ImportError: DLL load failed: The specified module could not be found. Failed to load the native TensorFlow runtime.

完整追溯:

File "C:\Users\Yinqi\anaconda3\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.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "predict.py", line 6, in <module>
    import tensorflow as tf
  File "C:\Users\Yinqi\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\Yinqi\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
    from tensorflow.python.eager import context
  File "C:\Users\Yinqi\anaconda3\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
    from tensorflow.python import pywrap_tfe
  File "C:\Users\Yinqi\anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Yinqi\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Yinqi\anaconda3\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.

Python 版本 3.7.7,windows 版本 20h2

我正在看这个但不确定如何解决它:https://github.com/tensorflow/tensorflow/issues/38916

编辑: 运行ning tensorflow 似乎需要 cpu 支持我没有的 AVX。

默认的 tensorflow 包不再支持

CPU 不支持 AVX。但是有一个解决方法,您必须从源代码编译或使用 google colaboratory 才能工作。更多信息可以参考here.