mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
ml: fix check in SVM::trainAuto
This commit is contained in:
parent
c2096771cb
commit
0dfab6bbd0
@ -1451,7 +1451,7 @@ public:
|
||||
sortSamplesByClasses( _samples, _responses, sidx_all, class_ranges );
|
||||
|
||||
//check that while cross-validation there were the samples from all the classes
|
||||
if( class_ranges[class_count] <= 0 )
|
||||
if ((int)class_ranges.size() < class_count + 1)
|
||||
CV_Error( CV_StsBadArg, "While cross-validation one or more of the classes have "
|
||||
"been fell out of the sample. Try to reduce <Params::k_fold>" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user