Python: How can I reshape 3D Images (np array) to 1D and then reshape them back correctly to 3D?
If M is (32 x 32 x 3), then .reshape(1,-1) will produce a 2d array (not 1d), of shape (1, 32*32*3).  That can be reshaped back to (32,32,3) with the same sort of reshape statement.
But that's reshaping the input to and from  But you haven't told us what the output of your Net is like.  What shape does it have?  How are you trying to reshape the output, and what is wrong with it?
I have RGB images (32 x 32 x 3) saved as 3D numpy arrays which I use as input for my Neural Net (using tensorflow). In order to use them as an input I reshape them to a 1D np array (1 x 3072) using reshape(1,-1). When I finish training my Net I want to reshape the output back, but using reshape(32,32,3) doesn't seem to provide the desired outcome.
Is this the correct way to do it? How I can be sure that each datum will be back to the correct place?