Insufficient memory in function cvAlloc, how to release memory?
I have tried training my own classifier for a couple of times now (to detect cows) and just when I finally fine-tune my images in the positives data-set, I run into this while training:
I realize I have to release memory in order to free some space and referred to THIS
But I am actually a little confused as to how to proceed further. Can anyone help with an optimal solution for this so that I can resume my training? Thanks in advance.
Note:
- my positives vary from 20-25KB on an average and negatives from 30-55KB.
- Positives: 355x 280 pixels, I read somewhere that w,h must maintain this aspect ratio , hence used -w 71 -h 56
- Im using 133 positives and 200 negatives, cows in positives all face the left side ( same profile)
EDIT::
text version:
PS E:\FYP\haar training\jo_haartrain> .\haartraining.exe -data cascades -vec vector/vector.vec -bg negative/bg.txt -n pos 67 -nneg 200 -nstages 12 -mem 2000 -mode ALL -w 64 -h 32
Data dir
name: cascades
Vec file name: vector/vector.vec
BG file name: negative/bg.txt
Num pos: 67
Num neg: 200
Num stages: 12
Num splits: 1 (stump as weak classifier)
Mem: 2000 MB
Symmetric: TRUE
Min hit rate: 0.995000
Max false alarm rate: 0.500000
Weight trimming: 0.950000
Equal weights: FALSE
Mode: ALL
Width: 64
Height: 32
Max num of precalculated features: 1309083
Applied boosting algorithm: GAB
Error (valid only for Discrete and Real AdaBoost): misclass
Max number of splits in tree cascade: 0
Min number of positive samples per cluster: 500
Required leaf false alarm rate: 0.000244141
Tree Classifier Stage
+---+ | 0| +---+
Number of features used : 1472939
Parent node: NULL
* 1 cluster *
please be so kind, and replace the screenshot with a text version, thank you !
(also forget the aishack page, that's from opencv1.0, and no more relevant)
is that 32bit, somehow ?
How much RAM do you have? Also, answer berak's question about using the 32-bit memory space. If you use Win32/x86 as the architecture of your executable file, you are limited to 4GB of RAM (including the memory space taken up by Windows, which is a hog).
could it be this file ?
Yes, Win32/x86, 4GB RAM. I read somewhere that the images are stored during the processing, how do I release this to fee some memory?
opencv version : is it opencv 1.0 ?
@LBerger, not nessecarily. sad as it is, the harrrrr training code is still mostly c-based.
@LBerger , no, it is opencv 3.4.0. any idea how i can free up the opencv cache n proceed with my training?
@Joshitha , unfortunately you cannot free anything there.
"Win32/x86, 4GB RAM" -- there's your problem.
oh no..!!! this means i cant train anything anymore? even if i reduce the number of images, i get the error :(