我正在使用张量流对象检测api训练对象检测模型。 eval配置如下:
eval_config: { num_examples: 8000 max_evals: 10 num_visualizations: 20 include_metrics_per_category: true }
但是,tensorboard不会显示任何类别指标。还有什么我需要做的吗?
啊我觉得github的pycocotools不支持这个功能。我们在Google内部实现了这一功能,但在外部无法使用。
以下步骤帮助我成功显示每个类别的指标(在faster_rccn和mobilenet上测试):
1.从我的git repo安装更新的pycocotools:
点击安装“git + https://github.com/philippschw/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI”
2.在tensorflow api中编辑此文件:
“tensorflow / models / research / object_detetcion / metrics / coco_tools.py”:从第240行到第244行
添加以下代码行:
# add for metrics per catergory from here
if include_metrics_per_category is True:
self.summarize_per_category()
# add for metrics per category end here
3.编辑Tensorflow API的配置文件,包括:
{metrics_set:“coco_detection_metrics”include_metrics_per_category:true}
例如:
eval_config: {
num_examples: 8000
# Note: The below line limits the evaluation process to 10 evaluations.
# Remove the below line to evaluate indefinitely.
max_evals: 10
num_visualizations: 20
metrics_set: "coco_detection_metrics"
include_metrics_per_category: true
}
请注意,这个问题已经在tensorflow上打开了,我现在的解决方案来自there。