Could you post the complete stack trace, which should show which operation raises this error?
I assume you are passing a noise input in the shape [50, 300] and expect the model to output a tensor as [50, 1, 28, 28]?