Tensorflow 1.9/对象检测:model_main.py 只评估一张图片
我已经更新到 Tensorflow 1.9 &对象检测 API 的最新大师.在运行以前运行良好的培训/评估课程时(我认为是 1.6 版),培训似乎按预期进行,但我只得到评估 &一张图片(第一张)的指标.
I've updated to Tensorflow 1.9 & the latest master of the Object Detection API. When running a training/evaluation session that worked fine previously (I think version 1.6), the training appears to proceed as expected, but I only get evaluation & metrics for one image (the first).
在 Tensorboard 中,图像被标记为Detections_Left_Groundtruth_Right".评估步骤本身也发生得非常快,这让我相信这不仅仅是 Tensorboard 的问题.
In Tensorboard the image is labeled 'Detections_Left_Groundtruth_Right'. The evaluation step itself also happens extremely quickly, which leads me to believe this isn't just a Tensorboard issue.
查看model_lib.py,我看到一些可疑代码(靠近第349行):
Looking in model_lib.py, I see some suspicious code (near line 349):
eval_images = (
features[fields.InputDataFields.original_image] if use_original_images
else features[fields.InputDataFields.image])
eval_dict = eval_util.result_dict_for_single_example(
eval_images[0:1],
features[inputs.HASH_KEY][0],
detections,
groundtruth,
class_agnostic=class_agnostic,
scale_to_absolute=True)
这对我来说就像评估者总是对第一张图像进行单一评估.有没有人看到和/或解决了这个问题?如果更改上述作品,我会更新.
This reads to me like the evaluator is always running a single evaluation on the first image. Has anyone seen and/or fixed this? I will update if changing the above works.
您说得对,对象检测仅支持批量大小为 1 的评估.评估的数量等于评估步骤的数量.评估指标跨批次累积.
You are right, object detection supports only batch sizes of 1 for evaluation. The number of evaluations is equal to the number of eval steps. Eval metrics are accrued across batches.
顺便说一句,在 Tensorboard 中查看更多评估图像的更改刚刚提交给 master.
Btw, a change to view more eval images in Tensorboard was just submitted to master.