提前停止 Tensorflow 对象检测 API

ELA*_*tak 5 python object-detection tensorflow object-detection-api tensorflow2.0

正如标题所示,是否有办法在 TF 对象检测 API 上实现提前停止?

我在对象检测的 github 上的这个线程https://github.com/tensorflow/models/issues/5887中读到,有一个用于早期停止的存储库https://github.com/hongym7/early_stopping。但这是 TF1 的旧版本,我使用 TF2

有什么办法可以实现提前停止吗model_main_tf2.py?我花了几个小时阅读代码,但我没有看到任何地方可以实现提前停止。

这是训练模型的脚本的链接 https://github.com/tensorflow/models/blob/master/research/object_detection/model_main_tf2.py

Dac*_*hao 2

将其重写tf.keras并使用tf.keras.callbacks.EarlyStopping. 阅读https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/EarlyStopping了解更多详细信息