Showing an image with pylab.imshow()

This is the problem, if you pass a 3D ndarray, it expects that you will have 3 or 4 planes (RGB or RGBA) (Read the code on line 410 in the last frame of the stack trace). You just need to get rid of the extra dimension using or To see what squeeze is doing, see the following … Read more