Skip to content

Instantly share code, notes, and snippets.

@bhuiyanmobasshir94
Created May 22, 2019 02:51
Show Gist options
  • Save bhuiyanmobasshir94/2d03ab070d68f18b4721a94785378b8e to your computer and use it in GitHub Desktop.
Save bhuiyanmobasshir94/2d03ab070d68f18b4721a94785378b8e to your computer and use it in GitHub Desktop.
Example of per process gpu memory limit. This isn't specific to Mask RCNN and is a simple tensorflow config option. Example below will use 20% of your GPU memory per process.
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
tf_config = tf.ConfigProto()
tf_config.gpu_options.per_process_gpu_memory_fraction = 0.2
set_session(tf.Session(config=tf_config))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment