TensorFlow训练报错:ResourceExhaustedError: OOM when allocating tensor device:GPU:0 by allocator GPU_0_b
使用TensorFlow训练某些较大模型时会发生内存溢出,如果 已经安装了TensorFlow-GPU版本,训练时会优先调用GPU版本的TensorFlow,而一般电脑上显存比较小,很容易发生溢出,就会出现如下报错:ResourceExhaustedError: OOM when allocating tensor with shape[1024,728,1,1] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by