(亲测可行!!!)ImportError: DLL load failed: 找不到指定的模块,Failed to load the native TensorFlow runtime.

81 篇文章 4 订阅

完整报错如下:

Traceback (most recent call last):
  File "E:\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "E:\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "E:\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "E:\anaconda\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "E:\anaconda\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "G:/A_机器2/workspace/随机梯度下降/demo3.py", line 12, in <module>
    import tensorflow
  File "E:\anaconda\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "E:\anaconda\lib\site-packages\tensorflow\python\__init__.py", line 50, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "E:\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 69, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "E:\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "E:\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "E:\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "E:\anaconda\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "E:\anaconda\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。


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.

Process finished with exit code 1

亲测可行:

打开Anaconda Prompt,输入如下命令行:

pip install tensorflow==1.15

python 3.7安装成功
在这里插入图片描述
成功把最新版本TensorFlow1.12卸载并安装为TensorFlow1.15版本,最后,博主得出这么一个结论:由于版本的不断更替,导致网上的教程仅仅适用于当时的TensorFlow版本,所以依照教程安装时,尽量用教程中的TensorFlow版本

附上代码测试一下吧

	import tensorflow as tf
    hello = tf.constant('Hello Tensorflow')
    sess = tf.Session()
    print(sess.run(hello))

在这里插入图片描述

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WGS.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值