Opencv_TrainCascade OutOfMemoryException

asked 2015-12-26 22:34:50 -0500

MRDaniel gravatar image

Hello,

I am using opencv_traincascades but face an out of memory exception when numPos > 10000 and numNeg >10000. I have a dataset of 2700 cropped images and have run opencv_createsamples to generate 10 images per input image giving me ~27000+ and ~27000- images.

When i run with LBP, i am able to reach stage 20 on -numNeg 22000 -numPos 21000. (Other posts recommend using a smaller value than the total number of samples for these parameters). HOG will run at .numNeg 5000 and numPos 5000 but this is just a quarter of my dataset.

When i do the same for HOG or even HAAR i get an OutOfMemoryException. I have 8Gb of memory available and no other RAM consuming programs/processes running. Ubuntu 32bit.

OpenCV Error: Insufficient memory (Failed to allocate XXXXXXXXXX bytes) in OutOfMemoryError, file /tmp/pkg/OpenCV-2.4.1/modules/core/src/alloc.cpp, line 52

HAAR and HOG are floating point and LBP is integer i believe which could be affecting this result.

1) Anyway to calculate max +/- image number for given RAM and feature type? 2) I am using samples which are 80 width and 40 height. Is this too big? 3) If i train for 20 stages with one quarter of my dataset, then change the input to another set of image for another 20 stages, how should this be done?

Regards,

edit retag flag offensive close merge delete

Comments

Hello,the traincascade application and 32-bit operating systems won't do well together espacilly with HAAR features,i suggest using a 64-bit OS,when using traincascade with these parameters in my desktop pc (LBP features,2000 unique positve samples,450000 negative sub-windows,width 50,height 50) it is using almost 7 gigabytes of RAM.

can gravatar imagecan ( 2015-12-27 04:38:05 -0500 )edit