Guest User

Untitled

a guest
Jul 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import tensorflow as tf
  2. gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.3)
  3. sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))
  4.  
  5. # keras
  6. from keras.backend.tensorflow_backend import set_session
  7. config = tf.ConfigProto()
  8. config.gpu_options.per_process_gpu_memory_fraction = 0.1
  9. #config.gpu_options.allow_growth=True
  10. set_session(tf.Session(config=config))
Add Comment
Please, Sign In to add comment