1 | initial version |
it wants float32 for the data, and int32 for the labels, int64 is wrong for both x and y
2 | No.2 Revision |
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)
3 | No.3 Revision |
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)