gpt4 book ai didi

python - 函数声明时出现 Theano OSError

转载 作者:行者123 更新时间:2023-12-01 05:07:18 27 4
gpt4 key购买 nike

在声明 Theano 符号函数时,我得到一个 OSError 和回溯。有趣的是,相同的代码在不同的机器上运行。一台机器配置为使用 GPU,而另一台(有错误)仅配置为 CPU。有其他人经历过这种行为并知道如何继续吗?

  File "classifiers/mlp.py", line 37, in predict
f = theano.function([X], Y)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/function.py", line 223, in function
profile=profile)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/pfunc.py", line 511, in pfunc
on_unused_input=on_unused_input)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/function_module.py", line 1332, in orig_function
defaults)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/function_module.py", line 1198, in create
_fn, _i, _o = self.linker.make_thunk(input_storage=input_storage_lists)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/link.py", line 489, in make_thunk
output_storage=output_storage)[:3]
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/vm.py", line 882, in make_all
no_recycling))
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/op.py", line 618, in make_thunk
output_storage=node_output_storage)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 992, in make_thunk
keep_lock=keep_lock)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 935, in __compile__
keep_lock=keep_lock)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 1372, in cthunk_factory
key=key, fn=self.compile_cmodule_by_step, keep_lock=keep_lock)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cmodule.py", line 1005, in module_from_key
module = next(compile_steps)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 1287, in compile_cmodule_by_step
preargs=preargs)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cmodule.py", line 1962, in compile_str
p_out = output_subprocess_Popen(cmd)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/misc/windows.py", line 73, in output_subprocess_Popen
p = subprocess_Popen(command, **params)
File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/misc/windows.py", line 36, in subprocess_Popen
proc = subprocess.Popen(command, startupinfo=startupinfo, **params)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1153, in _execute_child
self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory

最佳答案

我不确定为什么它在声明 Theano 的符号函数时被触发,但这是一个简单的内存问题。减少内存使用量解决了我的问题。

关于python - 函数声明时出现 Theano OSError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24763371/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com