错误:ResourceExhaustedError: Graph execution error: OOM when allocating tensor with shape[32,14,14,512] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc [[{{node model/multiply_20/mul-0-0-TransposeNCHWToNHWC-LayoutOptimizer}}]] Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info. This isn't available when running in Eager mode. [Op:__inference_train_function_20637]
解决: 调小 batch_size
去掉了几个attention module
我也不清楚对结果的影响有多少