简体   繁体   中英

Theano on Windows 64-bit and vanilla Python 3.5

I would like to use Theano on Windows 10 64-bit and a vanilla Python 3.5 install. Here's where I got stuck:

  • I have Python 3.5.2 64-bit version from python.org.
  • I installed NumPy 1.11.2 and SciPy 0.18.1 from Christoph Gohlke's page.
  • pip install theano got me Theano 0.8.2
  • I installed MSYS2 and then used its Pacman to install MinGW64.
  • I added MinGW to the PATH.
  • There is a libpython35.a in D:\\Python35\\Libs although I didn't put it there.

Now I'm getting these errors when trying to run Theano tests or Lasagne:

Problem occurred during compilation with the command line below:
D:\msys2\mingw64\bin\g++.exe -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -D_hypot=hypot -march=haswell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -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 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit -mno-mwaitx -mno-clzero -mno-pku --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=haswell -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -ID:\Python35\lib\site-packages\numpy\core\include -ID:\Python35\include -ID:\Python35\lib\site-packages\theano\gof -o C:\Users\Márton\AppData\Local\Theano\compiledir_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.5.2-64\tmpf0hafy5j\m0cee5d6551f2e027b5d68bb77d6b83a4.pyd C:\Users\Márton\AppData\Local\Theano\compiledir_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.5.2-64\tmpf0hafy5j\mod.cpp -LD:\Python35\libs -LD:\Python35 -lpython35
ERROR (theano.gof.opt): Optimization failure due to: constant_folding
ERROR (theano.gof.opt): node: Elemwise{Cast{float64}}(TensorConstant{(1, 1) of 0.5})
ERROR (theano.gof.opt): TRACEBACK:
ERROR (theano.gof.opt): Traceback (most recent call last):
  File "D:\Python35\lib\site-packages\theano\gof\opt.py", line 1772, in process_node
    replacements = lopt.transform(node)
  File "D:\Python35\lib\site-packages\theano\tensor\opt.py", line 5825, in constant_folding
    no_recycling=[])
  File "D:\Python35\lib\site-packages\theano\gof\op.py", line 970, in make_thunk
    no_recycling)
  File "D:\Python35\lib\site-packages\theano\gof\op.py", line 879, in make_c_thunk
    output_storage=node_output_storage)
  File "D:\Python35\lib\site-packages\theano\gof\cc.py", line 1200, in make_thunk
    keep_lock=keep_lock)
  File "D:\Python35\lib\site-packages\theano\gof\cc.py", line 1143, in __compile__
    keep_lock=keep_lock)
  File "D:\Python35\lib\site-packages\theano\gof\cc.py", line 1595, in cthunk_factory
    key=key, lnk=self, keep_lock=keep_lock)
  File "D:\Python35\lib\site-packages\theano\gof\cmodule.py", line 1142, in module_from_key
    module = lnk.compile_cmodule(location)
  File "D:\Python35\lib\site-packages\theano\gof\cc.py", line 1506, in compile_cmodule
    preargs=preargs)
  File "D:\Python35\lib\site-packages\theano\gof\cmodule.py", line 2183, in compile_str
    compile_stderr = decode(p_out[1])
  File "D:\Python35\lib\site-packages\theano\compat\__init__.py", line 42, in decode
    return x.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 10: invalid continuation byte

What am I doing wrong?

Theano documentation states that they don't like paths that contain spaces. But they never realized that paths that contain accented letters also crash their code. My Windows username is derived from my Microsoft account which uses my full name which contains an á , me being Hungarian. Adding this to .theanorc fixed the problem.

[global]
base_compiledir = D:\theano\

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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