简体   繁体   English

Python 2.7 编译失败 (theano),Windows 10

[英]Python 2.7 compilation failure (theano), windows 10

I tried looking at what others have done with problem similar to mine, but I still get the same error.我尝试查看其他人对与我类似的问题所做的工作,但我仍然遇到相同的错误。 I have no idea what's causing it.我不知道是什么原因造成的。 I've tried following: How to install Theano on Anaconda Python 2.7 x64 on Windows?我尝试过以下操作: 如何在 Windows 上的 Anaconda Python 2.7 x64 上安装 Theano?

but that didn't help.但这没有帮助。

I'm trying to run this example, but with my own dataset: https://github.com/Lasagne/Lasagne/blob/master/examples/mnist.py我正在尝试运行此示例,但使用我自己的数据集: https : //github.com/Lasagne/Lasagne/blob/master/examples/mnist.py

Error message is as follows, I didn't include the 787 other lines inbetween:错误信息如下,我没有包括中间的 787 其他行:

C:\Anaconda2\python.exe "C:/Users/mikrolab/Dropbox/Skole UiS/4. semester/Master/Master/hoved/ansiktsgjenkjenning/sklearntest.py" mlp 400

C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\tensor\signal\downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.
  "downsample module has been moved to the theano.tensor.signal.pool module.")

Loading data...
Building model and compiling functions...
WARNING (theano.gof.compilelock): Overriding existing lock by dead process '10436' (I am process '16120')


Problem occurred during compilation with the command line below:
C:\Anaconda2\Scripts\g++.bat -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=core2 -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -msse4.1 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=core2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m32 -IC:\Anaconda2\lib\site-packages\numpy\core\include -IC:\Anaconda2\include -IC:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof -o C:\Users\mikrolab\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-2.7.11-32\tmpahcj6d\df1196e30ea06df2bcfcd011958dc6f5.pyd C:\Users\mikrolab\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-2.7.11-32\tmpahcj6d\mod.cpp -LC:\Anaconda2\libs -LC:\Anaconda2 -lpython27

Traceback (most recent call last):

File "C:/Users/mikrolab/Dropbox/Skole UiS/4. semester/Master/Master/hoved/ansiktsgjenkjenning/sklearntest.py", line 312, in <module>

C:\Users\mikrolab\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-2.7.11-32\tmpahcj6d\mod.cpp: In member function 'int {anonymous}::__struct_compiled_op_df1196e30ea06df2bcfcd011958dc6f5::run()':

C:\Users\mikrolab\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-2.7.11-32\tmpahcj6d\mod.cpp:457:34: error: cannot convert 'npy_int64* {aka long long int*}' to 'npy_intp* {aka int*}' in argument passing

main(**kwargs)

File "C:/Users/mikrolab/Dropbox/Skole UiS/4.semester/Master/Master/hoved/ansiktsgjenkjenning/sklearntest.py", line 245, in main
    updates = updates)
  File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\compile\function.py", line 322, in function
    output_keys=output_keys)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\compile\pfunc.py", line 480, in pfunc
    output_keys=output_keys)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\compile\function_module.py", line 1779, in orig_function
    defaults)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\compile\function_module.py", line 1643, in create
    input_storage=input_storage_lists, storage_map=storage_map)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\link.py", line 690, in make_thunk
    storage_map=storage_map)[:3]

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\vm.py", line 1005, in make_all
    no_recycling))

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\op.py", line 978, in make_thunk
    no_recycling)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\op.py", line 881, in make_c_thunk
    output_storage=node_output_storage)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\cc.py", line 1200, in make_thunk
    keep_lock=keep_lock)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\cc.py", line 1143, in compile
    keep_lock=keep_lock)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\cc.py", line 1595, in cthunk_factory
    key=key, lnk=self, keep_lock=keep_lock)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\cmodule.py", line 1142, in module_from_key
    module = lnk.compile_cmodule(location)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\cc.py", line 1506, in compile_cmodule
    preargs=preargs)

File "C:\Anaconda2\lib\site-packages\theano-0.8.0-py2.7.egg\theano\gof\cmodule.py", line 2204, in compile_str
    (status, compile_stderr.replace('\n', '. ')))
Exception: ('The following error happened while compiling the node', mrg_uniform{TensorType(float32, 4D),inplace}(<TensorType(int32, matrix)>, MakeVector{dtype='int64'}.0), '\n', "Compilation failed (return status=1): 

C:\\Users\\mikrolab\\AppData\\Local\\Theano\\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-2.7.11-32\\tmpahcj6d\\mod.cpp: In member function 'int {anonymous}::__struct_compiled_op_df1196e30ea06df2bcfcd011958dc6f5::run()':\r. 

C:\\Users\\mikrolab\\AppData\\Local\\Theano\\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-2.7.11-32\\tmpahcj6d\\mod.cpp:457:34: error: cannot convert 'npy_int64* {aka long long int*}' to 'npy_intp* {aka int*}' in argument passing\r. ", '[*1 -> mrg_uniform{TensorType(float32, 4D),inplace}(<TensorType(int32, matrix)>, <TensorType(int64, vector)>), *1::1]')

Process finished with exit code 1

Solved : Followed every part of the following instructions: http://deeplearning.net/software/theano/install_windows.html#install-windows已解决:遵循以下说明的每一部分: http : //deeplearning.net/software/theano/install_windows.html#install-windows

did this as well: Why can't nvcc find my Visual C++ installation?也这样做了:为什么 nvcc 找不到我的 Visual C++ 安装?

Theano is working now and is using my GPU. Theano 现在正在工作并且正在使用我的 GPU。

Use Microsoft Visual Studio 2010 with Anaconda as you have to use the same compiler they used for packages you compile to be compatible.将 Microsoft Visual Studio 2010 与 Anaconda 一起使用,因为您必须使用它们用于编译的包的相同编译器才能兼容。 They do have mingw bindings but I'm not sure how compatible they are.它们确实有 mingw 绑定,但我不确定它们的兼容性如何。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM