3

在 Ubuntu 操作系统上运行 theano.test() 时,会产生一些关于优化失败的错误消息,如下所示:

ERROR (theano.gof.opt): Optimization failure due to: constant_folding

ERROR (theano.gof.opt): TRACEBACK:

ERROR (theano.gof.opt): Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/theano/gof/opt.py", line 1286, in process_node
replacements = lopt.transform(node)
File "/usr/local/lib/python2.7/dist-packages/theano/tensor/opt.py", line 3996, in constant_folding
no_recycling=[])

File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/__init__.py", line 237, in make_thunk
compute_map, no_recycling)

File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 606, in make_thunk
output_storage=node_output_storage)

File "/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py", line 948, in make_thunk
keep_lock=keep_lock)

File "/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py", line 891, in __compile__
keep_lock=keep_lock)

File "/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py", line 1322, in cthunk_factory
key=key, fn=self.compile_cmodule_by_step, keep_lock=keep_lock)
File "/usr/local/lib/python2.7/dist-packages/theano/gof/cmodule.py", line 996, in module_from_key
module = next(compile_steps)

File "/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py", line 1237, in compile_cmodule_by_step
preargs=preargs)

File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/nvcc_compiler.py", line 444, in compile_str
return dlimport(lib_filename)

File "/usr/local/lib/python2.7/dist-packages/theano/gof/cmodule.py", line 284, in dlimport
rval = __import__(module_name, {}, {}, [module_name])

ImportError: ('/home/csz/.theano/compiledir_Linux-3.11.0-20-generic-x86_64-with-Ubuntu-12.04-precise-x86_64-2.7.3-64/tmpcF2It0/3ea6a99a1a8d1d8523de8d72c27b90f4.so: undefined symbol: _Z25CudaNdarray_CopyFromArrayP11CudaNdarrayP23tagPyArrayObject_fields', '[GpuFromHost(TensorConstant{0.0})]')

有谁知道解决这些问题的方法,或者到底发生了什么?

4

1 回答 1

2

这可能是由很多事情造成的。该错误与 GPU 有关。因此,首先,确保您可以编译 nvidia 示例并且它们运行良好。确保这不是问题。

问题是 Theano 无法导入它编译的 GPU 模块,因为他没有找到它需要的符号。这个缺失的符号“_Z25CudaNdarray_CopyFromArrayP11CudaNdarrayP23tagPyArrayObject_fields”位于 Theano 已经预编译的共享库中。

你的操作系统是什么?确保更新到 Theano 的最新开发版本。最近有一个修复程序(如果我没记错的话,星期一)可以在某些操作系统上解决这个问题。

于 2014-06-25T13:10:35.310 回答