OOM

在mnist上测试卷积网络时,显存不够导致下面的报错: 

ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[10000,32,28,28] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[node layer1-conv1/Conv2D (defined at /home/yangxl/files/PycharmProjects/yangxl/mnist_inference.py:27) = Conv2D[T=DT_FLOAT, data_format="NCHW", dilations=[1, 1, 1, 1], padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](layer1-conv1/Conv2D-0-TransposeNHWCToNCHW-LayoutOptimizer, layer1-conv1/weight/read)]]
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.

原文地址:https://www.cnblogs.com/yangxiaoling/p/10464803.html