Discussion:
[theano-users] MemoryError (Theano on CPU): Lenovo Thinkpad
Aaron Snoswell
2017-06-12 11:52:50 UTC
Permalink
I'm working through the the DeepLearning.net tutorials using Windows 64
bit, Python 3.6 and Theano installed through conda.

I was able to run the Classifying MNIST digits using Logistic Regression
<http://deeplearning.net/tutorial/logreg.html> demo fine, and got the same
results as listed in the tutorial, hitting 4 epochs/second (about double
the listed CPU performance in the tutorial). I then tried running the MLP
tutorial code <http://deeplearning.net/tutorial/mlp.html> (classify MNIST
digits using a simple MLP). During execution, the process gobbles up memory
continuously until I get a MemoryError and the python crashes. Watching the
task manager, I will occasionally see the memory usage drop - I assume this
is the garbage collector kicking in, but it happens rarely.

<Loading Image...>

I've tried adjusting the MLP 'batch_size' parameter;

- With a value of 1000 (therefore n_train_batches == 50) the code runs
until the patience condition causes it to stop (no crash)
- With the default of 20 (n_train_batches == 2500) the code gets to
epoch 17 and crashes
- With a value of 10 (n_train_batches == 5000) I only get to epoch 3
before it crashes

Is this behavior expected with the hardware specs of the laptop I'm running
on? I've attached my DxDiag results here, but I've got 20GB of ram on this
machine.

Just trying to figure out if this crashing behavior is expected, or if I'm
seeing a memory leak of some sort.

Thanks.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frédéric Bastien
2017-06-12 22:00:33 UTC
Permalink
This is not normal.

Did you install the conda package mkl- service ?

Try to update numpy. It could also help.
Post by Aaron Snoswell
I'm working through the the DeepLearning.net tutorials using Windows 64
bit, Python 3.6 and Theano installed through conda.
I was able to run the Classifying MNIST digits using Logistic Regression
<http://deeplearning.net/tutorial/logreg.html> demo fine, and got the
same results as listed in the tutorial, hitting 4 epochs/second (about
double the listed CPU performance in the tutorial). I then tried running
the MLP tutorial code <http://deeplearning.net/tutorial/mlp.html> (classify
MNIST digits using a simple MLP). During execution, the process gobbles up
memory continuously until I get a MemoryError and the python crashes.
Watching the task manager, I will occasionally see the memory usage drop -
I assume this is the garbage collector kicking in, but it happens rarely.
<https://lh3.googleusercontent.com/-4EYsaeVqr_w/WT5-SyEMmWI/AAAAAAAAEZw/z3aqQrLFVVcdVfqfnlLDvvS7n8WH8Qt9QCLcB/s1600/theano-running-memory.PNG>
I've tried adjusting the MLP 'batch_size' parameter;
- With a value of 1000 (therefore n_train_batches == 50) the code runs
until the patience condition causes it to stop (no crash)
- With the default of 20 (n_train_batches == 2500) the code gets to
epoch 17 and crashes
- With a value of 10 (n_train_batches == 5000) I only get to epoch 3
before it crashes
Is this behavior expected with the hardware specs of the laptop I'm
running on? I've attached my DxDiag results here, but I've got 20GB of ram
on this machine.
Just trying to figure out if this crashing behavior is expected, or if I'm
seeing a memory leak of some sort.
Thanks.
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Aaron Snoswell
2017-06-18 01:51:27 UTC
Permalink
Hello.

Thanks for the reply - I do indeed have mkl-service installed. I ran conda
update --all and am still getting the same results. If anyone has any other
suggestions I'm all ears.

Thank you,

On Tue, Jun 13, 2017 at 8:00 AM, Frédéric Bastien <
Post by Frédéric Bastien
This is not normal.
Did you install the conda package mkl- service ?
Try to update numpy. It could also help.
Post by Aaron Snoswell
I'm working through the the DeepLearning.net tutorials using Windows 64
bit, Python 3.6 and Theano installed through conda.
I was able to run the Classifying MNIST digits using Logistic Regression
<http://deeplearning.net/tutorial/logreg.html> demo fine, and got the
same results as listed in the tutorial, hitting 4 epochs/second (about
double the listed CPU performance in the tutorial). I then tried running
the MLP tutorial code <http://deeplearning.net/tutorial/mlp.html> (classify
MNIST digits using a simple MLP). During execution, the process gobbles up
memory continuously until I get a MemoryError and the python crashes.
Watching the task manager, I will occasionally see the memory usage drop -
I assume this is the garbage collector kicking in, but it happens rarely.
<https://lh3.googleusercontent.com/-4EYsaeVqr_w/WT5-SyEMmWI/AAAAAAAAEZw/z3aqQrLFVVcdVfqfnlLDvvS7n8WH8Qt9QCLcB/s1600/theano-running-memory.PNG>
I've tried adjusting the MLP 'batch_size' parameter;
- With a value of 1000 (therefore n_train_batches == 50) the code
runs until the patience condition causes it to stop (no crash)
- With the default of 20 (n_train_batches == 2500) the code gets to
epoch 17 and crashes
- With a value of 10 (n_train_batches == 5000) I only get to epoch 3
before it crashes
Is this behavior expected with the hardware specs of the laptop I'm
running on? I've attached my DxDiag results here, but I've got 20GB of ram
on this machine.
Just trying to figure out if this crashing behavior is expected, or if
I'm seeing a memory leak of some sort.
Thanks.
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to a topic in the
Google Groups "theano-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/theano-users/Rz408i5rx2k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
Aaron Snoswell
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frédéric Bastien
2017-06-19 22:15:57 UTC
Permalink
Using Theano dev version could help you. If that don't fix it, using Python
3.5 could help. It fixed problem we are not able to reproduce for some
people.
Post by Aaron Snoswell
Hello.
Thanks for the reply - I do indeed have mkl-service installed. I ran conda
update --all and am still getting the same results. If anyone has any other
suggestions I'm all ears.
Thank you,
On Tue, Jun 13, 2017 at 8:00 AM, Frédéric Bastien <
Post by Frédéric Bastien
This is not normal.
Did you install the conda package mkl- service ?
Try to update numpy. It could also help.
Post by Aaron Snoswell
I'm working through the the DeepLearning.net tutorials using Windows 64
bit, Python 3.6 and Theano installed through conda.
I was able to run the Classifying MNIST digits using Logistic Regression
<http://deeplearning.net/tutorial/logreg.html> demo fine, and got the
same results as listed in the tutorial, hitting 4 epochs/second (about
double the listed CPU performance in the tutorial). I then tried running
the MLP tutorial code <http://deeplearning.net/tutorial/mlp.html> (classify
MNIST digits using a simple MLP). During execution, the process gobbles up
memory continuously until I get a MemoryError and the python crashes.
Watching the task manager, I will occasionally see the memory usage drop -
I assume this is the garbage collector kicking in, but it happens rarely.
<https://lh3.googleusercontent.com/-4EYsaeVqr_w/WT5-SyEMmWI/AAAAAAAAEZw/z3aqQrLFVVcdVfqfnlLDvvS7n8WH8Qt9QCLcB/s1600/theano-running-memory.PNG>
I've tried adjusting the MLP 'batch_size' parameter;
- With a value of 1000 (therefore n_train_batches == 50) the code
runs until the patience condition causes it to stop (no crash)
- With the default of 20 (n_train_batches == 2500) the code gets to
epoch 17 and crashes
- With a value of 10 (n_train_batches == 5000) I only get to epoch 3
before it crashes
Is this behavior expected with the hardware specs of the laptop I'm
running on? I've attached my DxDiag results here, but I've got 20GB of ram
on this machine.
Just trying to figure out if this crashing behavior is expected, or if
I'm seeing a memory leak of some sort.
Thanks.
--
---
You received this message because you are subscribed to the Google
Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to a topic in the
Google Groups "theano-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/theano-users/Rz408i5rx2k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
Aaron Snoswell
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...