Shape error when making out-of-sample predictions

Shape issues can be anything but trivial. My suggestion is to trim down the model to the simplest form and slowly add complexity. That will help you pinpoint where the problems begin.

Another tool that is very useful is to sprinkle some print(x.eval().shape), where x is any intermediate model variable, to see if the variables are coming out with the shapes you expected.