PLT.imShow TypeError Dimensões inválidas para dados de imagem

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