【问题标题】:Tensorflow Error: ImportError: DLL load failed: The specified module could not be foundTensorflow 错误:ImportError:DLL 加载失败:找不到指定的模块
【发布时间】:2020-07-30 16:50:42
【问题描述】:

我查看了以前对类似问题的回答,但找不到适合我的答案。

我已经使用 TensorFlow 很长时间了。目前正在试用 Yolov4,它需要使用 TensorFlow 2.3.0 版本,所以我决定安装那个。

Anaconda 的最新版本是 2.1.0,在我的电脑上运行良好。因此,由于这还不够,我创建了一个新环境并使用 pip install tensorflow-gpu 安装了 Tensorflow,它安装了 2.3.0 版似乎没有错误。

然后对于import tensorflow as tf 我得到这个错误。有什么想法可以尝试解决这个问题吗?

>>> import tensorflow as tf
Traceback (most recent call last):
  File "C:\Users\mazat\Anaconda3\envs\tf23\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 "<stdin>", line 1, in <module>
  File "C:\Users\mazat\Anaconda3\envs\tf23\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\mazat\Anaconda3\envs\tf23\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
    from tensorflow.python.eager import context
  File "C:\Users\mazat\Anaconda3\envs\tf23\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
    from tensorflow.python import pywrap_tfe
  File "C:\Users\mazat\Anaconda3\envs\tf23\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\mazat\Anaconda3\envs\tf23\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\mazat\Anaconda3\envs\tf23\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 tensorflow anaconda tensorflow2.0 yolo


    【解决方案1】:

    看起来问题出在 Visual Studio 的旧版本 Redistributable 上。 使用这里的新版本,到目前为止它似乎可以工作!

    https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

    【讨论】:

    【解决方案2】:

    我遇到了类似的问题,更新 V​​isual Studio (https://visualstudio.microsoft.com/pt-br/downloads/) 对我有用。

    【讨论】:

    • 请不要只使用链接回答。请提供一些带有上下文的示例。以后链接可能失效了,你的回答就没用了
    猜你喜欢
    • 2017-11-14
    • 2013-12-10
    • 2016-08-19
    • 2016-08-22
    • 2018-10-23
    • 2020-04-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多