这就是我在opencv-python
def svmTrain(self):
print "CCC\n"
points=[]
labels=[]
f=open('fv2.txt', 'rb')
objs = []
while 1:
try:
objs.append(cPickle.load(f))
except EOFError:
break
for i in range(0,len(objs)):
labels.append(int(objs[i][0][0]))
fv=objs[i][1][0]
points.append(fv)
print "DDD\n"
print labels
svmpoints=np.array(points,dtype=np.float32)
svmlabels=np.array(labels,dtype=np.float32)
print "EEE\n"
model = cv2.SVM(svmpoints,svmlabels)
print "FFF\n"
model.save("model.xml")
print "The end\n"
但它会给出错误执行
TypeError:不支持响应数据类型= 18
请帮我找一个如何在python中创建SVM model