Epoch 1/5 won't stop When i run my code with 5 epochs, code gets stuck at first epoch and run continuesly. I tried applying various parameters but couldn't make it.

here is my code...

import tensorflow as tf
import numpy as np
import os
from google.colab import drive
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow import keras
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D

training_path = 'drive/My Drive/tesla'
validation_path = 'drive/My Drive/validation'

training_generator = ImageDataGenerator(rescale=1.0/255)
validation_generator = ImageDataGenerator(rescale=1.0/255)

training_set = training_generator.flow_from_directory(batch_size=2,
                                                      directory=training_path,
                                                      target_size=(150,150),
                                                      class_mode='binary',
                                                      shuffle=True)

validation_set = validation_generator.flow_from_directory(batch_size=2,
                                                          directory=validation_path,
                                                          target_size=(150,150),

                                                          class_mode='binary')

model = keras.models.Sequential([
                                 Conv2D(8, 3, padding='same', activation='relu', input_shape=(150,150,3)),
                                 MaxPooling2D(),
                                 Conv2D(16, 3, padding='same', activation='relu'),
                                 MaxPooling2D(),
                                 Conv2D(16, 3, padding='same', activation='relu'),
                                 MaxPooling2D(),
                                 Conv2D(4, 3, activation='relu'),
                                 Flatten(),
                                 Dense(4, activation='relu'),
                                 Dense(1)

])

model.compile(optimizer='adam',
              loss=tf.losses.BinaryCrossentropy(from_logits=True),
              metrics=['accuracy'])

model.fit(training_set,
          validation_data=validation_set,
          epochs=5,
          verbose=1,
          validation_steps=20/2)


but when i run my code, it shows this and run non stop at first epoch.

Epoch 1/5
  14781/Unknown - 630s 43ms/step - loss: 4.0421e-06 - accuracy: 1.0000


Although my training sample size is only 40 (20 cats and 20 dogs) and validation sample size is 20 (10 cats and 10 dogs). I am coding in google colab.

Thanks in advance.
You are missing one argument in your code. Following will fix your problem.
model.fit(training_set,
          training_steps= training_set.samples//training_set.batch_size,
          validation_data=validation_set,
          epochs=5,
          verbose=1,
          validation_steps=validation_set.samples//validation_set.batch_size)