【发布时间】:2020-11-23 13:21:49
【问题描述】:
我已经使用以下代码通过 anaconda 安装了 tensorflow:-
conda install tensorflow==2.0.0
但我无法导入它并且弹出以下错误:-
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py in
<module>
57
---> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow_internal.py
in <module>
27 return _mod
---> 28 _pywrap_tensorflow_internal = swig_import_helper()
29 del swig_import_helper
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow_internal.py
in swig_import_helper()
23 try:
---> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname,
description)
25 finally:
~\anaconda3\envs\iNeuron\lib\imp.py in load_module(name, file, filename, details)
241 else:
--> 242 return load_dynamic(name, filename, file)
243 elif type_ == PKG_DIRECTORY:
~\anaconda3\envs\iNeuron\lib\imp.py in load_dynamic(name, path, file)
341 name=name, loader=loader, origin=path)
--> 342 return _load(spec)
343
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
我通过降级 tensorflow 版本尝试了多种方法,但似乎没有任何效果。 请求某人帮助我解决这个问题。 提前致谢。
【问题讨论】:
-
见this 我有类似的问题并最终设法找到解决方案。尝试这些步骤,如果您有任何问题,请在评论中写下我非常乐意提供帮助。
标签: python windows tensorflow