tensorflow - 我可以在 pipeline.config 中为 TF2 对象检测 API 定义多个 metrics_set
问题描述
我一直想知道是否可以为一个模型定义多个 metrics_set。我阅读了源代码,阅读了大量文章,甚至学习了 proto2 语法以查看是否可以根据需要修改代码。但无法得到任何结果。(另外 .config 文件看起来不像是用 proto2 编写的)。
有什么建议么?
解决方案
TensorFlow Object Detection API 目前支持三种评估协议,可以在 EvalConfig 中通过将 metrics_set 设置为相应的值来进行配置。
- coco_detection_metrics
- pascal_voc_detection_metrics
- oid_V2_detection_metrics
这意味着,蝙蝠右侧tensorflow 2.X
支持 3 个评估指标及其细微变化。Tensorflow 在项目中提到了它们,但您必须下载它们并自己编译 protobuf 并将其放在您的 python 项目下。这提到了 tensorflow 支持和已经可用的评估指标列表。
要在您的项目中安装coco_detection_metrics
和使用它们,请执行以下操作:
git clone https://github.com/cocodataset/cocoapi.git
cd coco/PythonAPI && make
如果我可以为一个模型定义多个metrics_set?
改变pipeline.config
不会帮助你做到这一点。评估实际上是一个您必须运行的单独过程。pipeline.config
在我看来,在培训进行期间,您绝对可以在指向单独文件的培训目录上运行多个评估。
以您的配置文件为例。
#file coco.config
eval_config: {
metrics_set: "coco_detection_metrics"
use_moving_averages: false
batch_size: 1
num_visualizations: 10
max_num_boxes_to_visualize: 5
visualize_groundtruth_boxes: true
eval_interval_secs: 30
}
... other stuff
--
#file pascal.config
eval_config: {
metrics_set: "pascal_voc_detection_metrics"
use_moving_averages: false
batch_size: 1
num_visualizations: 10
max_num_boxes_to_visualize: 5
visualize_groundtruth_boxes: true
eval_interval_secs: 30
}
.... other stuff
然后同时运行两个评估。在两个不同的端口中运行一个单独的张量板来查看每个端口。
!python object_detection/model_main_tf2.py \
--pipeline_config_path={pipeline_file} \
--model_dir='path/to/training/dir' \
--alsologtostderr \
--checkpoint_dir='path/to/training/checkpoint'
推荐阅读
- c# - Azure 服务总线客户端是否会自动重试从服务总线返回的暂时性错误?
- microsoft-graph-api - MS Graph API - 外出回复
- javascript - dsaSign 并且不适用于私钥
- python - 将许多 .npz 文件保存在一个大 .npz 文件中
- python - vscode jupyter笔记本编辑器的问题
- makefile - 为 linux 内核构建运行 makefile 时的未知选项
- python - 将 ID 与 pandas DataFrame 上的名称匹配
- html - 显示不透明的文本
- python - 重新加载资源管理器:默认
- javascript - 如何根据他的重复计数对 JavaScript 数组进行排序