This is probably because the summary() is executed before compile() the model(discriminator).
ValueError: This model has not yet been built. Build the model first by calling build() or calling fit() with some data. Or specify input_shape or batch_input_shape in the first layer for automatic build.
This is probably because the summary() is executed before compile() the model(discriminator).