我正试图在Windows上的anaconda上安装带有theano后端的keras,
我按照链接中的步骤进行操作:
How do I install Keras and Theano in Anaconda Python on Windows?
安装没有出错,但是当我运行一个简单的代码时:
from keras.models import Sequential
print('rrrrrrrrrrrrrr')
我收到以下错误:
File "test.py", line 2, in <module>
from keras.models import Sequential
File "C:\Users\alihd\Anaconda3\lib\site-packages\keras\__init__.py", line 3, in <module>
from . import utils
File "C:\Users\alihd\Anaconda3\lib\site-packages\keras\utils\__init__.py", line 6, in <module>
from . import conv_utils
File "C:\Users\alihd\Anaconda3\lib\site-packages\keras\utils\conv_utils.py", line 3, in <module>
from .. import backend as K
File "C:\Users\alihd\Anaconda3\lib\site-packages\keras\backend\__init__.py", line 80, in <module>
from .theano_backend import *
File "C:\Users\alihd\Anaconda3\lib\site-packages\keras\backend\theano_backend.py", line 3, in <module>
import theano
File "C:\Users\alihd\Anaconda3\lib\site-packages\theano\__init__.py", line 110, in <module>
from theano.compile import (
File "C:\Users\alihd\Anaconda3\lib\site-packages\theano\compile\__init__.py", line 12, in <module>
from theano.compile.mode import *
File "C:\Users\alihd\Anaconda3\lib\site-packages\theano\compile\mode.py", line 11, in <module>
import theano.gof.vm
File "C:\Users\alihd\Anaconda3\lib\site-packages\theano\gof\vm.py", line 673, in <module>
from . import lazylinker_c
File "C:\Users\alihd\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 127, in <module>
preargs=args)
File "C:\Users\alihd\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 2353, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1):
C:\Users\alihd\AppData\Local\Theano\compiledir_Windows-10-10.0.15063-
AMD64_Family_21_Model_112_Stepping_0_AuthenticAMD-2.7.13-
64\lazylinker_ext\mod.cpp:1:0: sorry, unimplemented: 64-bit mo. ^include
<Python.h>
为了运行代码,我使用:
设置后端到theano set "KERAS_BACKEND=theano"
python test.py #includes the python code
我正在使用Python 2.7.13