opencv_contrib icon indicating copy to clipboard operation
opencv_contrib copied to clipboard

SVM training - memory

Open opencv-pushbot opened this issue 9 years ago • 0 comments

Transferred from http://code.opencv.org/issues/1430

|| Pavel Zykán on 2011-10-18 07:41
|| Priority: Low
|| Affected: None
|| Category: ml
|| Tracker: Bug
|| Difficulty: None
|| PR: None
|| Platform: None / None

SVM training - memory

Hello,

I have a scenario where I train a set of SVM classifiers using "one against one" strategy. Since I have 62 classes to classify that means I need to train some 1891 SVMs. So far so good.

I train the SVMs using the train_auto function, and I notice that the memory consumption is growing really fast, even though the SVMs themselves are not very large (200 variables, 100 examples for each class => max 200 support vectors).

I have created a small program that illustrates the problem. I noticed that when I save the SVM model to a file, delete the instance and then load it from the file again, the memory consumption is much lower. When running the sample program as it is, it reached 407.776 kB of memory in use at the end, while with the save/load section uncommented, the program stopped at 35.560 kB.

Is it possible that the SVM does not clear all memory allocated during the training unless we call clear or delete? Or am I just missing something? Shouldn't the memory consumption be the same when I load the model from a file and when I use the training function?

Thanks!

Pavel Zykan

History

Alexander Shishkov on 2012-03-21 12:10
-   Target version deleted ()
Alexander Shishkov on 2012-03-25 20:25
-   Priority changed from Normal to Low
Alexander Shishkov on 2012-03-25 20:47
-   Assignee deleted (Maria Dimashova)
Alexander Shishkov on 2012-04-05 12:45
-   Target version deleted ()
Maria Dimashova on 2012-10-07 13:40
-   Target version deleted ()
Kirill Kornyakov on 2012-10-24 08:38
-   Target version set to Next Hackathon

opencv-pushbot avatar Jul 27 '15 08:07 opencv-pushbot