shape of theano tensor variable out of keras Conv2D
You can't get the shape of a theano tensor, because it is not fixed. The output of the convolutional layer is just a symbolic variable and its shape depends on whatever you put into the layer as input.

You can get the shape of the output for a specific input by making a theano function for the output of the layer, and feeding a numpy array through the function:

import numpy as np
input = np.ones(28*28).reshape(1, 1, 28, 28).astype('float32')
fn = theano.function([input_img], x)

print fn(input).shape
&gt;&gt;&gt; (1, 16, 28, 28)