Keras: real amount of GPU memory used

前端 未结 2 1454
[愿得一人]
[愿得一人] 2021-02-14 18:27

I\'m using Keras with Tensorflow backend and looking at nvidia-smi is not sufficient to understand how much memory current network architecture need because seems l

2条回答
  •  日久生厌
    2021-02-14 19:21

    You can still use nvidia-smi after telling TensorFlow not to reserve all memory of the GPU, but to grow this reservation on demand:

    config = tf.ConfigProto()
    config.gpu_options.allow_growth = True
    keras.backend.tensorflow_backend.set_session(tf.Session(config=config))
    

提交回复
热议问题