Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

it wants float32 for the data, and int32 for the labels, int64 is wrong for both x and y

it wants float32 for the data, and int32 for the labels, int64 is wrong for both x and y

try:

X = np.asarray(X, np.float32)
y = np.asarray(y, np.int32)
svm.train(X, cv2.ml.ROW_SAMPLE, y)

it wants float32 for the data, and int32 for the labels, int64 is wrong for both x and yy. you also need numpy arrays, not plain lists

try:

X = np.asarray(X, np.float32)
y = np.asarray(y, np.int32)
svm.train(X, cv2.ml.ROW_SAMPLE, y)