我只是pip安装了theano并尝试运行theano.test()。它产生了很长的错误记录,我复制了第一部分。我还尝试了其他几个例子 - 我见过
"local_dot_to_dot22"
和
"ValueError: invalid token "Files\Enthought\Canopy\App\appdata\canopy1.5.2.2785.win-x86_64\Scripts" in ldflags_str: "-LC:\Program Files\Enthought\Canopy\App\appdata\canopy-1.5.2.2785.win-x86_64\Scripts -lmk2_core -lmk2_intel_thread -lmk2_rt"
几次。
我使用的是python 2.7(canopy),scipy 0.15.1-2和numpy 1.9.2-1。我对theano很新。如果你能指出我正确的方向,我感激不尽。谢谢!
EEEEEERROR (theano.gof.opt): Optimization failure due to: local_dot_to_dot22
ERROR:theano.gof.opt:Optimization failure due to: local_dot_to_dot22
ERROR (theano.gof.opt): TRACEBACK:
ERROR:theano.gof.opt:TRACEBACK:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "c:\theano\theano\gof\opt.py", line 1737, in process_node
replacements = lopt.transform(node)
File "c:\theano\theano\tensor\blas.py", line 1776, in local_dot_to_dot22
return [_dot22(x.dimshuffle('x', 0), y).dimshuffle(1)]
File "c:\theano\theano\gof\op.py", line 647, in __call__
no_recycling=[])
File "c:\theano\theano\gof\op.py", line 918, in make_thunk
no_recycling)
File "c:\theano\theano\gof\op.py", line 836, in make_c_thunk
output_storage=node_output_storage)
File "c:\theano\theano\gof\cc.py", line 1175, in make_thunk
keep_lock=keep_lock)
File "c:\theano\theano\gof\cc.py", line 1113, in __compile__
keep_lock=keep_lock)
File "c:\theano\theano\gof\cc.py", line 1541, in cthunk_factory
key = self.cmodule_key()
File "c:\theano\theano\gof\cc.py", line 1257, in cmodule_key
compile_args=self.compile_args(),
File "c:\theano\theano\gof\cc.py", line 936, in compile_args
ret += x.c_compile_args()
File "c:\theano\theano\tensor\blas.py", line 652, in c_compile_args
return ldflags(libs=False, flags=True)
File "c:\theano\theano\tensor\blas.py", line 537, in ldflags
include_dir=include_dir)
File "c:\theano\theano\gof\utils.py", line 182, in rval
val = f(*args, **kwargs)
File "c:\theano\theano\tensor\blas.py", line 597, in _ldflags
% (t, ldflags_str))
ValueError: invalid token "Files\Enthought\Canopy\App\appdata\canopy- 1.5.2.2785.win-x86_64\Scripts" in ldflags_str: "-LC:\Program Files\Enthought\Canopy\App\appdata\canopy-1.5.2.2785.win-x86_64\Scripts -lmk2_core -lmk2_intel_thread -lmk2_rt"
答案 0 :(得分:3)
这里的问题是路径中有空格导致的问题,即C:\Program Files\Enthought\Canopy
中安装了Canopy,但Theano脚本与Program
和Files
之间的空间无法正常工作。尝试卸载Canopy并重新安装在路径中没有空格的目录中。
您还应该遵循installing Theano on Windows的其他说明。不幸的是,它并不像pip install theano
那么简单。
答案 1 :(得分:0)
如果您不想重新安装内容,如果它们是繁重的程序,例如影响Window的注册表等,您可以尝试符号链接。
符号链接将创建类似于文件夹快捷方式的内容,但被其他应用程序视为实际文件夹。
所以,你可以这样做:
cmd
mklink /D "C:\LinkToProgramFiles" "C:\Program Files"
然后,您开始在ldflags var中使用“C:\ LinkToProgramFiles”。