Scipy Kmeans exits with TypeError
问题 When running the code below, I'm getting a TypeError that says: "File "_vq.pyx", line 342, in scipy.cluster._vq.update_cluster_means TypeError: type other than float or double not supported" from PIL import Image import scipy, scipy.misc, scipy.cluster NUM_CLUSTERS = 5 im = Image.open('d:/temp/test.jpg') ar = scipy.misc.fromimage(im) shape = ar.shape ar = ar.reshape(scipy.product(shape[:2]), shape[2]) codes, dist = scipy.cluster.vq.kmeans(ar, NUM_CLUSTERS) vecs, dist = scipy.cluster.vq.vq(ar,