Jupyter Notebook (only) Memory Error, same code run in a conventional .py and works : <p>I have an assignment for a Deep Learning class, and they provide a Jupyter notebook as a base code, the thing is that after running the data import and reshape, jupyter notebook through a "Memory Error", after some analysis y tried to compile the same code in a normal .py file, and everything runs well.</p>

<p>The thing is that I'm required (preferably) to use the Jupyter notebook as the base for development, since is more interactive for the kind of task.</p>

<pre><code>&lt;ipython-input-2-846f80a40ce2&gt; in &lt;module&gt;()
  2 # Load the raw CIFAR-10 data
  3 cifar10_dir = 'datasets\\'
----&gt; 4 X, y = load_CIFAR10(cifar10_dir)

C:\path\data_utils.pyc in load_CIFAR10(ROOT)
     18     f = os.path.join(ROOT, 'cifar10_train.p')
     19     print('Path:  ' + f );
---&gt; 20     Xtr, Ytr = load_CIFAR_batch(f)
     21     return Xtr, Ytr
     22 

C:\path\data_utils.pyc in load_CIFAR_batch(filename)
     10         X = np.array(datadict['data'])
     11         Y = np.array(datadict['labels'])
---&gt; 12         X = X.reshape(-1, 3, 32, 32).transpose(0,2,3,1).astype("float")
     13         return X, Y
     14 

MemoryError: 
</code></pre>

<p>The error occurs in the line 12, i know is a memory consuming assignment, but that doesn't mean that 4 GB of RAM wont suffice, and that was confirmed when the code run without problems outside Jupyter.</p>

<p>My Guess is it has something to do with the memory limit either by Jupyter or by Chrome, but I'm not sure and also dont know how to solve it.</p>

<p>By the way:</p>

<ul>
<li>I have a Windows 10 laptop with 4GB of RAM</li>
<li>and Chrome Version 57.0.2987.133 (64-bit)</li>
</ul>
