Finish 50 epochs need 13.89 hr

You can tweak with the batch size. Reduce the batch_size.

Also where you mentioned steps per epoch for training data set, kindly add the if length statement the way you added for validation data set.

Get the steps per epoch (may be a few lines of code)
ADD THE BELOW CODE LINE TO THE STEPS_PER_EPOCH FOR THE LENGTH OF TRAINING DATA
if length_of_validation_dataset % BATCH_SIZE > 0:
steps_per_epoch += 1

one needs to understand in this assignment, training would depend on steps per epoch which is again related to batch_size.

if reducing the batch_size, didn’t get you desired result, then kindly DM me. Click on my name and then message. Do not post any codes here on the public post thread as these codes are graded.

Regards
DP

Hello Shiri_Gordon,

  1. In your def define_and_compile_model():
    your model.compile needs correction or change of optimizer
    Read the below instruction to follow (Kindly do not include metric)
  • compile the model:
  • Set the optimizer parameter to Stochastic Gradient Descent using [SGD] * When using SGD, set the momentum to 0.9 and keep the default learning rate. (Note: To avoid grading issues, please use tf.keras.optimizers.SGD instead of tf.keras.optimizers.experimental.SGD. We will remove this note once the grader has been updated to recognize the experimental module.).
  1. Also your math.ceil is not same has the steps I mentioned as it lacks step_per_epoch +=1 step in that, so kindly use the one I mentioned in previous comments.

Kindly let me know, once your issue is resolved.

Regards
DP