Skip to content

Instantly share code, notes, and snippets.

@bckim92
Last active June 3, 2016 02:50
Show Gist options
  • Save bckim92/5459129651c7744d02f1db03426231fa to your computer and use it in GitHub Desktop.
Save bckim92/5459129651c7744d02f1db03426231fa to your computer and use it in GitHub Desktop.
# ver1
config = tf.ConfigProto( gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.5), device_count = {'GPU': 1})
sess = tf.Session(config=config)
# ver2
config = tf.ConfigProto(log_device_placement=True, device_count={'GPU': 1})
config.gpu_options.per_process_gpu_memory_fraction=0.3 # don't hog all vRAM
config.operation_timeout_in_ms=15000 # terminate on long hangs
sess = tf.Session(config=config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment