TypeError: only size-1 arrays can be converted to Python scalars

TypeError: only size-1 arrays can be converted to Python scalars

img0 = int(imgs[0]*255)
出现TypeError: only size-1 arrays can be converted to Python scalars

改为 img0 = (imgs[0]*255).astype(np.int),因为img[0]是 numpy形式的数组

你可能感兴趣的:(TypeError: only size-1 arrays can be converted to Python scalars)