'ResourceExhaustedError: Exception encountered when calling layer "batch_normalization_10" (type BatchNormalization)

When I run a transformer code for video prediction, the code itself should be correct but an error occured:

ResourceExhaustedError: Exception encountered when calling layer "batch_normalization_10" (type BatchNormalization).

OOM when allocating tensor with shape[8,4,1600,64] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc [Op:FusedBatchNormV3]

Call arguments received: • inputs=tf.Tensor(shape=(8, 4, 40, 40, 64), dtype=float32) • training=True

How can I tackle this problem? I think it is not a very big tensor...



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source