I have a gray scale image as an array with shape (256,256,1) and I want to flatten it to have shape (65536,).
I tried using reshape , flatten and ravel but nothing works.
I also looked at this answer
but I don't really understand the solution as I am a beginner in python.
How do I go about solving this?
Edit:
This is the line of code that makes the problem
image_width = image_height = 256
X[0] = np.reshape(X[0],(image_width*image_height))
Where X has the following shape: (64, 256, 256, 1)
dtype of array is float32