How to calculate optimal batch size

前端 未结 5 1957
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 13:30

Sometimes I run into a problem:

OOM when allocating tensor with shape

e.q.

OOM when allocating tensor wi

5条回答
  •  不知归路
    2020-12-02 14:20

    You can estimate the largest batch size using:

    Max batch size= available GPU memory bytes / 4 / (size of tensors + trainable parameters)

提交回复
热议问题