plt.imshow typeError dimensiones no válidas para datos de imagen

if image.shape[2] == 1:
    image = image[:, :, 0]
return image
Merwanski