I am getting line an error-215 while training an SVM with OpenCV-Python
In line 100, in <module>svm.train(train_data,cv.ml.ROW_SAMPLE,train_labels) cv2.error: D:\Build\OpenCV\opencv-3.4.0\modules\ml\src\data.cpp:259: error: (-215) samples.type() == 5 || samples.type() == 4 in function cv::ml::TrainDataImpl::setData
Line 100 is: svm.train(train_data,cv.ml.ROW_SAMPLE,train_labels)
train_data is an n-D numpy array with shape [60, 256,512] and type Float 32.
train_labels is a numpy array with shape [60,1] and type int32.
I am unable to understand what the error possibly means, and any help would be appreciated. I am working with OpenCV 3, Python 3.5.X, Windows 10, 64-bit
please show your code for this.
shape [60, 256,512]
-- this does not look correct. a 2d array, like [60, 131072] is required there (each sample has to go on a single, flat row, while you seem to have an array of 2d objects).