在运行keras时报错:
Problem occurred during compilation with the command line below:
D:programMinGWing++.exe -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=ivybridge -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=ivybridge -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m32 -ID:Program Filespython_3.5libsite-packages
umpycoreinclude -ID:Program Filespython_3.5include -ID:Program Filespython_3.5libsite-packages heanogof -o C:UserslinbirgAppDataLocalTheanocompiledir_Windows-10-10.0.10586-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.1-32 mp_whdx5tmm0208238a661f4723098a69a01f936a9a.pyd C:UserslinbirgAppDataLocalTheanocompiledir_Windows-10-10.0.10586-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.1-32 mp_whdx5tmmod.cpp -LD:Program Filespython_3.5libs -LD:Program Filespython_3.5 -lpython35
In file included from D:Program Filespython_3.5libsite-packages
umpycoreinclude/numpy/arrayobject.h:4:0,
from C:UserslinbirgAppDataLocalTheanocompiledir_Windows-10-10.0.10586-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.1-32 mp_whdx5tmmod.cpp:5:
C:UserslinbirgAppDataLocalTheanocompiledir_Windows-10-10.0.10586-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.1-32 mp_whdx5tmmod.cpp: In member function 'int {anonymous}::__struct_compiled_op_m0208238a661f4723098a69a01f936a9a::run()':
D:Program Filespython_3.5libsite-packages
umpycoreinclude/numpy/ndarrayobject.h:135:77: error: cannot convert 'npy_int64* {aka long long int*}' to 'npy_intp* {aka int*}' in argument passing
PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)
^
C:UserslinbirgAppDataLocalTheanocompiledir_Windows-10-10.0.10586-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.1-32 mp_whdx5tmmod.cpp:457:34: note: in expansion of macro 'PyArray_SimpleNew'
V1 = (PyArrayObject*)PyArray_SimpleNew(4, odims, 11);
该问题为theano的bug,Pascal Lamblin对其进行了确认
https://groups.google.com/forum/#!topic/theano-users/cqdsmr6mfDg/discussion
github上对其进行了修改,并合并到master上
https://github.com/Theano/Theano/pull/4336/commits/0d8030db7c2889d9540c3d28a83eb0d842462fb8。
我是从github上下载最新的rng_mrg.py,并替换theano/sandbox/rng_mrg.py文件。