theano CPU running out of memory: what is wrong?
<p>I run a simple network with theano on the server and got out-of-memory error, but I am not sure what is the reason. I am asking because it is unlikely to be just because I am using too much memory. </p>

<p>Here are the reasons:</p>

<p>First, according to this <a href="http://deeplearning.net/software/theano/faq.html#out-of-memory-but-not-really" rel="nofollow">post</a>, only when running with GPU will result in the problems caused by no support of virtual memory, but I am running it with CPU, so it should be fine. </p>

<p>Second, I build a network where the first layer is a matrix 100k by 10, and the second layer is 10 by 1, so it's just about 1M numbers for the model. So far, I only tried with 1000 data points together, so even if the machine load all the data together, and initialize all the layers together, there should be at most 110M float numbers. I used float32, on a 64bit machine. According to this <a href="http://deeplearning.net/software/theano/tutorial/python-memory-management.html" rel="nofollow">post</a>, each number takes 60bytes at most. So, the whole initialization takes 6GB memory. Even if there could be a variate different resources that take up memory, I don't understand why it cannot run on a 128GB RAM server. </p>

<p>Can someone suggest what I should look into?</p>

<p>Just in case someone asks for code, <a href="https://github.com/y0ast/Variational-Autoencoder/blob/master/VAE.py" rel="nofollow">here</a> it is. </p>

<p>What size are your minibatches? You need to remember that the activations take space in memory too.</p>

python memory theano