Skip to content

Instantly share code, notes, and snippets.

@kiendang
Last active June 12, 2018 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiendang/7d7296033725d823ef8909a9a3b18b85 to your computer and use it in GitHub Desktop.
Save kiendang/7d7296033725d823ef8909a9a3b18b85 to your computer and use it in GitHub Desktop.
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
gpu_options = tf.GPUOptions(allow_growth=True, per_process_gpu_memory_fraction=0.333)
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))
set_session(sess)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment