Tensorflow 1.9/对象检测:model_main.py 只评估一张图片 [英] Tensorflow 1.9 / Object Detection: model_main.py only evaluates one image

查看:89
本文介绍了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.

这篇关于Tensorflow 1.9/对象检测:model_main.py 只评估一张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆