Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using your sample code provided I don't get any issue at all, though I did change the maximum number of iterations down to 1000 so I could run it in a reasonable amount of time.

Looking at the source code near that assertion I spy the following:

if( !train1( sample_count, var_count, samples, svm_type == ONE_CLASS ? 0 : responses->data.i, 0, 0, temp_storage, alpha, df->rho ))

for( i = 0; i < sample_count; i++ )
    sv_count += fabs(alpha[i]) > 0;

CV_Assert(sv_count != 0);

So you either have 0 samples and the sv_count is never increasing (it is initialized to 0) or every alpha value is equal to 0 (since the use of fabs precludes negative values here)