caffe-windows
caffe-windows copied to clipboard
Bug inside predict_box_layer.cpp for MTCNN face detector
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.
Can you tell me at this time, count=?
count equals 147
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.
It looks like a magic, but after your fix it works well. Thank you so much!