解决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. 归一化=
欢迎大家交流学习,任何问题都可以留言
还没有评论,来说两句吧...