Number of epochs

hi. How should I decide the number of epochs to train the model? I can’t just do trial and error in a large dataset like 10 thousand images. I should have some estimation of the number of epochs beforehand to train the model.

Supposing that you have split your data into training and validation sets, we can assume that as long as the training and validation errors drop, the training should continue without any problem. I can say here the best idea is to keep an eye on the validation error as long as it starts increasing you can stop the training.

From my perspective, you can set as many epochs as you want and stop model training when the validation error starts to raise. In TensorFlow, the early stopping from Keras API can help you to stop the training when needed accuracy and loss values are achieved. You can read more on early stopping here: EarlyStopping