BOWKMeansTrainer Max Images?

asked 2016-08-18 07:30:05 -0500

MRDaniel gravatar image


I am training BOWKMeansTrainer with a dataset of 30,000 images using AKAZE features and descriptors.

When i hit the 3500 sample on call int BowTrainer.add(descriptor), i receive an error. My machine has 16Gb of RAM and over 9Gb is available at the time of the error. Project is VS2015 with x64 configuration. The number of clusters is set to 1000 initially, then 400 and finally 16. All yielding the same result. Do i need more?

All cv::Mat created in the loop are released correctly.

What is the limit to the number of images that can be trained? Is there a way to use multiple BOW trainers if i had sub-classes of images?

Is this a limitation with debug versus release dlls for memory allocation?

OpenCV Error: Insufficient memory (Failed to allocate 883200 bytes) in cv::OutOfMemoryError, file C:\OpencvFull\opencv\modules\core\src\alloc.cpp, line 52 OpenCV Error: Assertion failed (u != 0) in cv::Mat::create, file C:\OpencvFull\opencv\modules\core\src\matrix.cpp, line 432

883200 bytes = 0.0008832 Gb?? 9Gb available..... Am i taking crazy pills here?


edit retag flag offensive close merge delete


... that's xxxx more bytes, than already allocated.

my guess: it fails in kmeans(), but we'd need you to set some breakpoints in the code, to see, where exactly it happens.

berak gravatar imageberak ( 2016-08-18 09:37:11 -0500 )edit

@berak. I will investigate in the morning. :)

MRDaniel gravatar imageMRDaniel ( 2016-08-18 10:21:31 -0500 )edit

some crazy pills left ?

berak gravatar imageberak ( 2016-08-18 10:30:45 -0500 )edit