Be nice to others - Don't
This is for users using Tensorflow or Keras.
Restrict use of GPU memory
from tensorflow import keras import tensorflow as tf config = tf.ConfigProto() config.gpu_options.allow_growth=True # This line is important so you don't occupy more memory than necessary. config.gpu_options.per_process_gpu_memory_fraction = 0.1 # This line gives the absolute maximum percentage (%) of the total GPU memory you allow yourself to use. # By combining those two lines, you can restrict how much memory you maximum will use, and also keras.backend.set_session(tf.Session(config=config))