Low GPU usage by Keras / Tensorflow?

前端 未结 5 1015
萌比男神i
萌比男神i 2021-02-12 18:01

I\'m using keras with tensorflow backend on a computer with a nvidia Tesla K20c GPU. (CUDA 8)

I\'m tranining a relatively simple Convolutional Neural Network, during tra

5条回答
  •  南旧
    南旧 (楼主)
    2021-02-12 18:27

    Could be due to several reasons but most likely you're having a bottleneck when reading the training data. As your GPU has processed a batch it requires more data. Depending on your implementation this can cause the GPU to wait for the CPU to load more data resulting in a lower GPU usage and also a longer training time.

    Try loading all data into memory if it fits or use a QueueRunner which will make an input pipeline reading data in the background. This will reduce the time that your GPU is waiting for more data.

    The Reading Data Guide on the TensorFlow website contains more information.

提交回复
热议问题