For datasets dimensions printout, following worked pretty good right after training (fit)
for i in model.layers:
        print("------")
#       print(i, "\n", i.input_shape, "\n", i.output_shape, "\n", i.get_weights())
        print(i, "\n", i.input_shape, "\n", i.output_shape, "\n")



860/860 [==============================] - 6s 7ms/step - loss: 0.6708 - accuracy: 0.7530 - val_loss: 0.4993 - val_accuracy: 0.8162
------
<keras.layers.convolutional.Conv2D object at 0x7f87bcdf11d0>
 (None, 28, 28, 1)
 (None, 28, 28, 64)

------
<keras.layers.pooling.MaxPooling2D object at 0x7f869ff17400>
 (None, 28, 28, 64)
 (None, 14, 14, 64)

------
<keras.layers.convolutional.Conv2D object at 0x7f869ff17630>
 (None, 14, 14, 64)
 (None, 14, 14, 128)

------
<keras.layers.convolutional.Conv2D object at 0x7f869ff17b38>
 (None, 14, 14, 128)
 (None, 14, 14, 128)

------
<keras.layers.pooling.MaxPooling2D object at 0x7f869ff45080>
 (None, 14, 14, 128)
 (None, 7, 7, 128)

------
<keras.layers.convolutional.Conv2D object at 0x7f869ff452b0>
 (None, 7, 7, 128)
 (None, 7, 7, 256)

------
<keras.layers.convolutional.Conv2D object at 0x7f869ff457b8>
 (None, 7, 7, 256)
 (None, 7, 7, 256)

------
<keras.layers.pooling.MaxPooling2D object at 0x7f869ff45cc0>
 (None, 7, 7, 256)
 (None, 3, 3, 256)

------
<keras.layers.core.Flatten object at 0x7f869ff45ef0>
 (None, 3, 3, 256)
 (None, 2304)

------
<keras.layers.core.Dense object at 0x7f869fecb0b8>
 (None, 2304)
 (None, 128)

------
<keras.layers.core.Dropout object at 0x7f869fecb3c8>
 (None, 128)
 (None, 128)

------
<keras.layers.core.Dense object at 0x7f869fecb4e0>
 (None, 128)
 (None, 64)

------
<keras.layers.core.Dropout object at 0x7f869fecb828>
 (None, 64)
 (None, 64)

------
<keras.layers.core.Dense object at 0x7f869fecb908>
 (None, 64)
 (None, 10)