本文介绍了如何使用python控制台修复Import keras错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我导入了具有tensorflow后端的keras,但是发生了此错误.我安装了tensoflow,之前是可以工作的.但是出现了一些错误消息,它不起作用.

I import keras with tensorflow backend, but this error is occured.I install tensoflow, is worked before. but some error message occured, it doesn't work.

>>>import keras <-- command
Using TensorFlow backend.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\bak40\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\__init__.py", line 3, in <module>
    from . import utils
  File "C:\Users\bak40\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\__init__.py", line 6, in <module>
    from . import conv_utils
  File "C:\Users\bak40\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\conv_utils.py", line 9, in <module>
    from .. import backend as K
  File "C:\Users\bak40\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\backend\__init__.py", line 89, in <module>
    from .tensorflow_backend import *
  File "C:\Users\bak40\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in <module>
    import tensorflow as tf
  File "C:\Users\bak40\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\bak40\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "C:\Users\bak40\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 7, in <module>
    from google.protobuf import descriptor as _descriptor
  File "C:\Users\bak40\AppData\Local\Programs\Python\Python36\lib\site-packages\google\protobuf\descriptor.py", line 47, in <module>
    from google.protobuf.pyext import _message
ImportError: DLL load failed: 지정된 프로시저를 찾을 수 없습니다.

谢谢.

推荐答案

尝试使用tensorflow.kerasimport keras

Keras切换到tensorflow.keras,这是tensorflow> = 1.10.0的一部分.

Keras switched to tensorflow.keras, which is a part of tensorflow >= 1.10.0.

这篇关于如何使用python控制台修复Import keras错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 15:41