DEV Community

Cover image for Preventing Keras to allocate unnecessary GPU memory
Talles L
Talles L

Posted on

Preventing Keras to allocate unnecessary GPU memory

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

for gpu in gpus:
  tf.config.experimental.set_memory_growth(gpu, True)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)