About MobileNet V2 base output shape

Hello. I m learning cnn’s and i have missing point about MobileNet V2 base output shape.
I m using this link as my reference: 사전 학습된 ConvNet을 이용한 전이 학습  |  TensorFlow Core
In the code I print the summary of base_model :
“base_model = tf.keras.applications.MobileNetV2(input_shape=IMG_SHAPE,
include_top=False,
weights=‘imagenet’)
base_model.summary()”
In last line of layers “output shape” is (None, 5, 5, 1280)
This is the output shape of base_model. So I expected to see (1,5,5,1280) shaped output for one image. However, when ı run:
" feature_batch = base_model(image)

print(feature_batch.shape)"
output is (32,5,5,1280) why there are 32 different layers in first dimension and why that 32 is not included in output shape of last layer?

As far as I understand, while following the tutorial, running base_model.summary() on its own prints the string summary of the pre-trained MobileNetV2 network with no inputs fed into the model yet (e.g. no image batch tensor of shape (32, 160, 160, 3) has been used as an input), hence the last layer’s output shape of (None, 5, 5, 1280) and the first layer’s shape of (None, 160, 160, 3).

You set the batch size initially here:

BATCH_SIZE = 32
IMG_SIZE = (160, 160)

train_dataset = tf.keras.utils.image_dataset_from_directory(train_dir,
                                                            shuffle=True,
                                                            batch_size=BATCH_SIZE,
                                                            image_size=IMG_SIZE)
...
# Instantiate the base model
base_model = tf.keras.applications.MobileNetV2(...)
...
image_batch, label_batch = next(iter(train_dataset))
# Pass the image batch (of 32) to the pre-trained MobileNetV2 `base_model()`
feature_batch = base_model(image_batch) 
# Print the shape
print(feature_batch.shape)

which then outputs:

(32, 5, 5, 1280)

If you simply run the same code but without feature extraction:

...
image_batch, label_batch = next(iter(train_dataset))
image_batch.shape # Check the shape

then the shape of the tensor will be:

TensorShape([32, 160, 160, 3])

(where 32 is the batch size.)

In addition:

where None means that dimension is unknown (and thanks @markdaoust).