python - 提前停止 TensorFlow 对象检测 API
问题描述
正如标题所暗示的那样,无论如何要在 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
解决方案
重写它tf.keras
并使用tf.keras.callbacks.EarlyStopping
. 阅读https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/EarlyStopping了解更多详情
推荐阅读
- python - 如何让 python 识别字符串中的正确子字符串?
- python - PyQt5:如何使用计时器每秒增加一个变量?
- html - 基于输入长度的动态宽度(和中心)输入
- javascript - 用于唤醒应用程序以进行 webrtc 调用的 Cordova 插件
- python - 使用 BeautifulSoup 遍历 XML 并拉取下一个兄弟
- django - 我必须将数据导入扩展到由 Django ORM 定义表结构的数据库中的常见方法是什么?
- ubuntu - 在 ubuntu 上永久编辑 PATH
- javascript - 如何使用 JavaScript 更改伪类元素?
- android - JobIntentService 在android Q中不起作用
- mysql - MYSQL /SQL 多别名基于列值