Skip to content

Instantly share code, notes, and snippets.

@ruslangrimov
Created May 30, 2018 02:33
Show Gist options
  • Save ruslangrimov/6f91c6ba679e19f0334645aa0862ccc9 to your computer and use it in GitHub Desktop.
Save ruslangrimov/6f91c6ba679e19f0334645aa0862ccc9 to your computer and use it in GitHub Desktop.
Make Keras use only a fraction of GPU memory
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.33
set_session(tf.Session(config=config))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment