keras导入错误没有属性'getdlopenflags'

时间:2016-10-09 15:45:26

标签: python machine-learning theano keras

我是keras的新用户,我已经下载了theanoscipynumpy个模块,但是当我想要import keras时,命令窗口告诉我

"Using TensorFlow backend.
Traceback (most recent call last):
File "F:\eclipse\dasd\aaa\aaaa.py", line 7, in <module>
import keras
File "D:\Anaconda2\lib\site-packages\keras\__init__.py", line 2, in <module>
from . import backend
File "D:\Anaconda2\lib\site-packages\keras\backend\__init__.py", line 64, in <module>
from .tensorflow_backend import *
File "D:\Anaconda2\lib\site-packages\keras\backend\tensorflow_backend.py", line 1, in <module>
import tensorflow as tf
File "D:\Anaconda2\lib\site-packages\tensorflow\__init__.py", line 23, in <module>
from tensorflow.python import *
File "D:\Anaconda2\lib\site-packages\tensorflow\python\__init__.py", line 47, in <module>
_default_dlopen_flags = sys.getdlopenflags()
    AttributeError: 'module' object has no attribute 'getdlopenflags'"

我的计算机系统是win7-64,我没有下载CUDA,因为我的显卡是ATI的。

1 个答案:

答案 0 :(得分:0)

Keras默认使用Tensorflow。您需要明确切换到Theano,请参阅当前过程的official documentation,例如将环境变量KERAS_BACKEND设置为theano