The error says what to do:
This model has not yet been built. Build the model first by calling
build()
model.build(input_shape) # `input_shape` is the shape of the input data
# e.g. input_shape = (None, 32, 32, 3)
model.summary()