PLT.imshow TypeError dimensi tidak valid untuk data gambar

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