Traceback (most recent call last):
File "D:\developer_tools\anaconda3\envs\lasagne0.2_py35\lib\site-packages\theano\compile\function_module.py", line 884, in __call__
self.fn() if output_subset is None else\
MemoryError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/Desktop/paper/Theano-LtRRE-master/Theano-LtRRE-master-py3-test/mnist.py", line 232, in
main()
File "D:/Desktop/paper/Theano-LtRRE-master/Theano-LtRRE-master-py3-test/mnist.py", line 191, in main
train_err += train_fn(inputs, targets)
File "D:\developer_tools\anaconda3\envs\lasagne0.2_py35\lib\site-packages\theano\compile\function_module.py", line 898, in __call__
storage_map=getattr(self.fn, 'storage_map', None))
File "D:\developer_tools\anaconda3\envs\lasagne0.2_py35\lib\site-packages\theano\gof\link.py", line 325, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "D:\developer_tools\anaconda3\envs\lasagne0.2_py35\lib\site-packages\six.py", line 718, in reraise
raise value.with_traceback(tb)
File "D:\developer_tools\anaconda3\envs\lasagne0.2_py35\lib\site-packages\theano\compile\function_module.py", line 884, in __call__
self.fn() if output_subset is None else\
MemoryError:
Apply node that caused the error: Elemwise{Composite{(i0 * (i1 + Abs(i1)))}}(TensorConstant{(1, 1, 1, 1) of 0.5}, Elemwise{Add}[(0, 0)].0)
Toposort index: 107
Inputs types: [TensorType(float64, (True, True, True, True)), TensorType(float64, 4D)]
Inputs shapes: [(1, 1, 1, 1), (32, 128, 10, 10)]
Inputs strides: [(8, 8, 8, 8), (102400, 800, 80, 8)]
Inputs values: [array([[[[ 0.5]]]]), 'not shown']
Outputs clients: [[CorrMM{valid, (1, 1), (1, 1)}(Elemwise{Composite{(i0 * (i1 + Abs(i1)))}}.0, Subtensor{::, ::, ::int64, ::int64}.0), CorrMM_gradWeights{valid, (1, 1), (1, 1)}(Elemwise{Composite{(i0 * (i1 + Abs(i1)))}}.0, Elemwise{Composite{((i0 * i1) + (i0 * i1 * sgn(i2)))}}[(0, 1)].0, Subtensor{int64}.0, Subtensor{int64}.0)]]
HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created. This can be done with by setting the Theano flag 'optimizer=fast_compile'. If that does not work, Theano optimizations can be disabled with 'optimizer=None'.
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
进程已结束,退出代码为 1
该报错表明可能是内存不足的问题。请重新检查您的设置,确保内存足够。也可以参考Theano[1]官方文档中给出的优化建议。另外,也可以尝试禁用Theano优化器,即设置optimizer=None,以便获取内存相关错误有关的详细诊断报告。
这个错误是内存不足导致的,通常是因为训练数据量太大,超出了你的计算机内存的限制。你可以尝试以下几种解决方法:
1.减少训练数据量,可以尝试使用更小的批量大小(batch size),或者减少训练数据的维度。
2.使用更大的内存,可以考虑更换计算机或者增加内存条。
3.开启Theano的fast_compile优化,这个优化可以降低Theano编译函数的开销,减少内存使用。你可以在代码中添加以下语句:
import theano
theano.config.optimizer = 'fast_compile'