C2W2_Assignment execution is too long

Here are a couple of tips to make the training faster:

  1. Change network architecture. Remember that the number of parameters of Conv2D layers orders of magnitude lower than the dense layer that follows a flatten layer.
  2. Leave the batch size at the default value i.e. 32 when possible. When GPU doesn’t have enough memory for training the dataset i.e. out of memory error is raised, reduce batch size to smaller values.
  3. Read this topic.
  4. Although time per epoch is unaffected by choice of learning rate, convergence of the model is influenced by this parameter. Values lower than 1e-3 better be tested on the dataset before using them as your final choice. Consider taking deep learning specialization to learn more about tuning the learning rate.
  5. Change the GPU allocated for you if you find the performance unacceptable. Execute !nvidia-smi on a notebook cell to find the compute capability of the GPU.
1 Like