Preventing Keras to allocate unnecessary GPU memory



This content originally appeared on DEV Community and was authored by Talles L

gpus = tf.config.experimental.list_physical_devices('GPU')

for gpu in gpus:
  tf.config.experimental.set_memory_growth(gpu, True)


This content originally appeared on DEV Community and was authored by Talles L