RTrees training fails due to Assertion in calcDir

asked 2016-02-02 03:55:03 -0600

pefue gravatar image

Hi,

I'm trying to train a random descision forest for regression but it fails due to an assertion in tree.cpp:1190

OpenCV Error: Assertion failed ((int)_sleft.size() < n && (int)_sright.size() < n) in cv::ml::DTreesImpl::calcDir, file C:\builds\master_PackSlave-win64-vc12-shared\opencv\modules\ml\src\tree.cpp, line 1190
exception caught: C:\builds\master_PackSlave-win64-vc12-shared\opencv\modules\ml\src\tree.cpp:1190: error: (-215) (int)_sleft.size() < n && (int)_sright.size() < n in function cv::ml::DTreesImpl::calcDir

With smaller training sets the forest seems to work fine, but as soon as I use > 20000 features it fails during training. My current settings are:

Ptr<RTrees> rtrees = RTrees::create();
rtrees->setMaxDepth(10);
rtrees->setMinSampleCount(10);
rtrees->setRegressionAccuracy(0.1f);
rtrees->setUseSurrogates(false);
rtrees->setMaxCategories(16);
rtrees->setPriors(Mat());
rtrees->setCalculateVarImportance(false);
rtrees->setActiveVarCount(1);
rtrees->setTermCriteria(TermCriteria(TermCriteria::MAX_ITER,100, 0));

Has anyone else experienced this problem or knows the reason for the error?

Thanks!

edit retag flag offensive close merge delete

Comments

OpenCV 2.4.11's regression forest seems to work fine with the same data and same settings.

pefue gravatar imagepefue ( 2016-02-08 15:34:08 -0600 )edit