'When reshaping array image output is noise

I am trying to implement a Convolutional Neural Network. However, it is not working and I found that when reshaping the array of images the output is just white noise. X_Train is a (100, 50, 81828) array and I have to reshape it to a (81828, 100, 50, 1) array.

plt.imshow(X_Train[:,:,1])
plt.show()
X_Train_R = X_Train.reshape(X_Train.shape[2], X_Train.shape[0], X_Train.shape[1],1)
plt.imshow(X_Train_R[1,:,:,0])
plt.show()


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source