Skip to content

Instantly share code, notes, and snippets.

@iamgroot42
Created January 28, 2018 12:38
Show Gist options
  • Save iamgroot42/5fff3f28e1f46a77ac6a9a41172a2d51 to your computer and use it in GitHub Desktop.
Save iamgroot42/5fff3f28e1f46a77ac6a9a41172a2d51 to your computer and use it in GitHub Desktop.
Dynamic memory allocation
import tensorflow as tf
import keras
# Don't hog GPU
config = tf.ConfigProto()
config.gpu_options.allow_growth=True
sess = tf.Session(config=config)
# If using Keras, add this line:
keras.backend.set_session(sess)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment