tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[32,1024,1,1024] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[{{node gradients/AddN_7/tmp_var}} = TemporaryVariable[dtype=DT_FLOAT, shape=[32,1024,1,1024], var_name="gradients/AddN_7/tmp_var", _device="/job:localhost/replica:0/task:0/device:GPU:0"](^gradients/conv5/bn/batchnorm/mul_1_grad/Sum_1, ^gradients/conv5/bn/batchnorm/mul_1_grad/Reshape)]]
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.
解决办法:减小batch的大小
或修改图片大小
或者确定显卡内存在哪一层不够,若是全连接层则降低修改全连接层维度