本文主要是介绍解决Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
解决Clipping input data to the valid range for imshow with RGB data ([0…1] for floats or [0…255] for integers).
报错描述
img = plt.imread('../dataset/car.jpg')
# img = img / 255.
pixels = np.reshape(img, (img.shape[0]*img.shape[1], 3))
...
...
plt.show() # 图片为空白,无内容
解决后
报错信息
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
解决办法
img = plt.imread('car.jpg')
img = img / 255.
=img = img / 255. 归一化=
欢迎大家交流学习,任何问题都可以留言
这篇关于解决Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!