diff --git a/modules/ml/src/boost.cpp b/modules/ml/src/boost.cpp index c2bdeafa90..e91b4f1165 100644 --- a/modules/ml/src/boost.cpp +++ b/modules/ml/src/boost.cpp @@ -1072,6 +1072,8 @@ CvBoost::train( const CvMat* _train_data, int _tflag, cvSeqPush( weak, &tree ); update_weights( tree ); trim_weights(); + if( cvCountNonZero(subsample_mask) == 0 ) + break; } get_active_vars(); // recompute active_vars* maps and condensed_idx's in the splits.