Description
Hi,
I have the following code to limit memory consumption of my process:
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.1
set_session(tf.Session(config=config))
In Keras 2.0.8, it successfully allocates only the required amount of memory (0.1) right after set_session(...) call.
But in Keras 2.0.9 this behavior changed: it allocates all of the GPU memory right at the from keras.backend.tensorflow_backend import set_session
import statement, so the subsequent set_session(...) with per_process_gpu_memory_fraction call has no effect.
It looks mostly like a bug, but in case it's expected, how can I limit my GPU memory allocation in 2.0.9?
Please make sure that the boxes below are checked before you submit your issue. If your issue is an implementation question, please ask your question on StackOverflow or join the Keras Slack channel and ask there instead of filing a GitHub issue.
Thank you!
-
Check that you are up-to-date with the master branch of Keras. You can update with:
pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps -
If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.
-
If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with:
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps -
Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).