0 问题
今天跑了一下程序,报了如下的OOM错误
ResourceExhaustedError: OOM when allocating tensor with shape[258000,768] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[{
{node rpn_model/rpn_conv_shared/convolution}} = 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"](fpn_p2/BiasAdd, rpn_conv_shared/kernel/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.
看报错主要是没内存了,按照如下思路进行纠错
1 解决
1.1 指定GPU
默认使用第0
块GPU,该用其他GPU
$ CUDA_VISIBLE_DEVICES