models icon indicating copy to clipboard operation
models copied to clipboard

Memory Error during training Object_Detection

Open june9713 opened this issue 9 years ago • 3 comments

Hi.

I'm trying to train object detection from scratch.

I'm using Windows 10 , i7-4720 2.6g , 16GB CPU memory , GTX-960M 2GB (free memory 1.6GB)

I'm sure data sets are o.k. And train command is o.k.

Because I don't have any errors with Tensorflow CPU Version.

But, I have memory error with Tensorflow GPU Version(Maybe).

And I have same Errors with Tensorflow GPU Version in Ububtu.

Error message is : .......... ............. ................ ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[64,7,7,512] [[Node: SecondStageFeatureExtractor/resnet_v1_101/block4/unit_3/bottleneck_v1/conv1/convolution = Conv2D[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/gpu:0"](SecondStageFeatureExtractor/resnet_v1_101/block4/unit_2/bottleneck_v1/Relu, SecondStageFeatureExtractor/resnet_v1_101/block4/unit_3/bottleneck_v1/conv1/weights/read/_3343)]] .......

I checked batch size was 1.

train.py print(train_config.batch_size)

647751264 = 102MB

I have 1.6GB free GPU Memory! I dont know why this error is occured.

Is this because of small memory? Or any other problem?

Please help me can slove this.

Thanks! :-)

june9713 avatar Jul 19 '17 10:07 june9713

Same question here: #1766.

2GB of memory is a bit low, but you could try to decrease the input image resolution or the batch_size (you can check the second stage batch size, I think by default it's 64).

tmattio avatar Jul 24 '17 08:07 tmattio

I think it's the image size. Because in this code there's a bit of teleprocessing to before sending it in to the algorithm . I think 2GB memory also low. I tried with higher resolution images in the cloud , even it failed .

shamanez avatar Jul 28 '17 17:07 shamanez

This question is better asked on StackOverflow since it is not a bug or feature request. There is also a larger community that reads questions there.

ymodak avatar Oct 31 '18 21:10 ymodak