The problem is input_shape
.
It should actually contain 3 dimensions only. And internally keras will add the batch dimension making it 4.
Since you probably used input_shape
with 4 dimensions (batch included), keras is adding the 5th.
You should use input_shape=(32,32,1)
.