Tensorflow per_process_gpu_memory_fraction not working

Viewed 1122

I'm using Tensorflow-gpu 1.10 because I had problems with cuDNN. I wanted to limit how much gpu it's using to 40% so I did

config.gpu_options.per_process_gpu_memory_fraction = 0.4
session = tf.Session(config=config)

I looked at Omen Control Center to see how much of the GPU I'm using, and it was using like 70% of the GPU instead. I'm not getting any error messages. My GPU is a GTX 1080. I have looked all over online and other people had similar problems, but none of the solutions worked. I'm also using Keras for for the models and layers. I am also doing this in Jupyter Notebook.

1 Answers

Try this one:

gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction = 0.4)
session = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)
Related