Many Thanks for the help. I was working for grayscale image classifier for 64*64 images.
RuntimeError: shape ‘[-1, 400]’ is invalid for input of size 10816
I had this error, I knew it was issue with my net flattening, but didn’t knew what to change. Read your post and solved the issue with 90% accuracy for my classifier.
4- Batch size
13 = squareRoot(10816/4/16)
I had to set x = x.view(4, 16 * 13 * 13).