Skip to content

Instantly share code, notes, and snippets.

@arjun-kava
Created December 24, 2018 05:04
Show Gist options
  • Save arjun-kava/175e8a5d2766e629c90a44020139615c to your computer and use it in GitHub Desktop.
Save arjun-kava/175e8a5d2766e629c90a44020139615c to your computer and use it in GitHub Desktop.
#### KERAS ####
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.3
set_session(tf.Session(config=config))
#### TF ####
config = tf.ConfigProto(
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.5),
device_count = {'GPU': 1}
)
sess_1 = tf.Session(graph=graph_1, config=config)
sess_2 = tf.Session(graph=graph_2, config=config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment