Tensorflow导入问题Python 3.6

时间:2019-11-25 12:28:25

标签: tensorflow keras pycharm python-3.6

我正在尝试通过遵循YouTube上的教程来学习如何创建机器学习算法,目前,我一直停留在上一部视频的最后一部分。我安装了 tensorflow keras 却没有问题,但是每次我在PyCharm编辑器中调用 import tensorflow 时,它都会给我这两个回溯痕迹< / p>

Traceback (most recent call last):<br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
<br/><br/>
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
<br/><br/>
During handling of the above exception, another exception occurred:
<br/><br/>
Traceback (most recent call last):<br/>
  File "C:/Users/Le Quient LewisII/PycharmProjects/tensorEnv/test.py", line 1, in <module>
    import tensorflow
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow\__init__.py", line 98, in <module>
    from tensorflow_core import *
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
    from tensorflow.python.tools import module_util as _module_util
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
    module = self._load()
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow\__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)<br/><br/>
ImportError: Traceback (most recent call last):<br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
<br/><br/>
  File "C:\Users\Le Quient LewisII\Anaconda3\envs\tensor\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
<br/><br/>
ImportError: DLL load failed: A dynamic link library (DLL)
initialization routine failed.

我不知道它们是什么意思。我尝试卸载并重新安装tensorflow ,但它仍然存在。如果有人可以帮助我解决这个问题,将不胜感激吗?

1 个答案:

答案 0 :(得分:0)

好的,所以我弄清楚了我的问题所在。这是一个内存问题,所以我切换到另一台笔记本电脑,现在工作正常。抱歉,漫长的等待时间