models icon indicating copy to clipboard operation
models copied to clipboard

Earlystopping and ModelCheckpoint callbacks

Open danielefundaro opened this issue 4 years ago • 10 comments

Prerequisites

Please answer the following question for yourself before submitting an issue.

  • [x] I checked to make sure that this feature has not been requested already.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/tree/master/research/object_detection/model_main_tf2.py

2. Describe the feature you request

I use the Tensorflow Object Detection API for a while now and I was wondering if there was a way to apply some callbacks like EarlyStopping and ModelCheckpoint, specifying them in the pipeline's train_config section.

3. Additional context

Add any other context about the feature request here.

4. Are you willing to contribute it? (Yes or No)

Yes

danielefundaro avatar Mar 01 '21 16:03 danielefundaro

@DanieleFundaro Please check the comment here and hope it answers your question. Thanks!

Duplicate #9582

saikumarchalla avatar Mar 02 '21 14:03 saikumarchalla

Unfortunately not. That problem was about the loading phase of a keras model. My request is about to add the possibility to manage callbacks like the Early Stopping for the object detection API (v2).

In the first version there was something but in the new version there isn't. I thought something like the following snippet to manage callbacks to train a new model using the object detection API:

train_config: {
  batch_size: 64
  sync_replicas: true
  replicas_to_aggregate: 8
  num_steps: 350000
  callbacks {
    early_stopping {
      monitor: "val_loss"
      min_delta: 0
      patience: 100
      mode: auto
    }
  }

Maybe there's something to add callbacks for a model but I didn't find until now.

danielefundaro avatar Mar 02 '21 21:03 danielefundaro

Any hint since March ?

I'm looking for something similar. If it still doesn't exist, is there a chance to contribute for that feature ?

chainyo avatar Jun 16 '21 17:06 chainyo

hi, I am also looking for EarlyStopping callback. Are there any updates?

hanikh avatar Jul 22 '21 05:07 hanikh

Same here. An EarlyStopping feature would be great. I have been trying to implement it somehow, but so far I've had no luck.

MatCorr avatar Sep 27 '21 14:09 MatCorr

I have implemented this feature. I can contribute

On Mon, Sep 27, 2021 at 6:14 PM Matheus Correia Ferreira < @.***> wrote:

Same here. An EarlyStopping feature would be great. I have been trying to implement it somehow, but so far I've had no luck.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/9766#issuecomment-927944565, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIWEAIENFTJ5C6AAU2A47TUEB7NBANCNFSM4YM4DMEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

hanikh avatar Sep 28 '21 05:09 hanikh

@hanikh do you have a github repo or example codes of your callbacks implementation?

fgraffitti-cyberhawk avatar Oct 05 '21 08:10 fgraffitti-cyberhawk

@hanikh, @ChainYo, and @fgraffitti-cyberhawk have anyone worked it out?

creativesalam avatar May 27 '22 01:05 creativesalam

Hi @creativesalam, I stopped using Tensorflow in favor of PyTorch and PyTorch Lightning, which better suit my needs.

chainyo avatar May 27 '22 07:05 chainyo

What a silly library! Even not supporting callbacks for early stopping? Don't they know early stopping is a key point in model training? They are deserved to be defeated by Pytorch!!

rzjiang0603 avatar Apr 22 '24 19:04 rzjiang0603