caffe-windows icon indicating copy to clipboard operation
caffe-windows copied to clipboard

Bug inside predict_box_layer.cpp for MTCNN face detector

Open zabelinka opened this issue 8 years ago • 4 comments

Hello! My name is Tanya. I am using your layers for developing MTCNN face detector. And I have found a bug inside a predict_box_layer.cpp in the CPU_ONLY mode. When processing the image 81.jpg after 80.jpg, I meet the error at the line 120:

top[1]->mutable_cpu_data()[i * 5 + 1] = bb_data[top[0]->offset(0, 1, y, x)];

Error mesage:

HEAP CORRUPTION DETECTED: after Normal block (#107479) at 0x000000000ED47000.
CRT detected that the application wrote to memory after end of heap buffer.

When debugging error message is like this: Access violation writing location 0x000000000ED47000.

Error occurs when i equal 147, and memory acess top[1]->mutable_cpu_data()[736] is corrupted. Please, can you tell me what could corrupt the memory or how to find the error cause.

zabelinka avatar Jun 28 '17 10:06 zabelinka

Can you tell me at this time, count=?

happynear avatar Jun 28 '17 14:06 happynear

count equals 147

zabelinka avatar Jun 28 '17 15:06 zabelinka

I think this may due to line 74. If I merge this line with 71-73, the logic will be too complex. Anyway, now I fixed it, can you try it again?

BTW, as I tested, the speed of CPU mode for MTCNN is not very fast. You may try https://github.com/AlphaQi/MTCNN-light as alternative.

happynear avatar Jun 28 '17 22:06 happynear

It looks like a magic, but after your fix it works well. Thank you so much!

zabelinka avatar Jun 29 '17 09:06 zabelinka