Fairly new to the Object Detection API here, using tf-gpu==1.15 for training and 2.2.0 for evaluation as well as python 3.7.
I am able to utilize data augmentation as well as adjust the decay of the learning rate in the ssd_mobilenet_v1.config file, but I am not sure how to go about implementing a way for the model to stop training if I am confident the loss will not get below a certain value no matter how many more steps it trains.
How or where do I configure / implement early stopping criteria?
You can make use of
EarlyStopping
callback from tensorflow. Refer tensorflow documentation here.Create a callback using -
monitor
- Change themonitor
param toloss
if u don't have validation data & want to stop training if training loss stops decreasing for 3 consecutive epochs. Also, u can change it toaccuracy
if u wish to stop training based on accuracy instead ofloss
.patience
- Number of epochs to wait before stopping the training if loss doesn't decrease or accuracy doesn't improveThen pass it to
fit
function while training -There are many examples online, u can check them!