Ask Your Question

Revision history [back]

SVM Train error: (-215:Assertion failed) problem

image description

Hi. I want to use svm for classification. I created train and label data. When i ran svm.train method, I see these errors

OpenCV(3.4.2) /io/opencv/modules/ml/src/svm.cpp:1381: error: (-215:Assertion failed) _samples.type() == 5 in function 'do_train'

svm=cv2.ml.SVM_create()
svm.setKernel(cv2.ml.SVM_LINEAR)
svm.setType(cv2.ml.SVM_C_SVC)
svm.train(X, cv2.ml.ROW_SAMPLE, y)

Any suggestions. Thanks.