【问题标题】:TF object detection API - Compute evaluation measures failedTF 对象检测 API - 计算评估措施失败
【发布时间】:2017-11-27 08:37:59
【问题描述】:

我成功地在我自己的数据集上训练了一个模型,导出了推理图并在我的测试数据集上进行了推理。

我现在有

  • 检测为 tfrecord 文件,在输入配置中指定
  • 具有指定指标集的 eval_config 文件

当我尝试计算新的对象检测器推断和评估度量计算tutorial 中的度量时

python object_detection/metrics/offline_eval_map_corloc.py --eval_dir=/media/sf_shared --eval_config_path=/media/sf_shared/eval_config.pbtxt --input_config_path=/media/sf_shared/input_config.pbtxt

它返回这个 AttributeError:

INFO:tensorflow:Processing file: /media/sf_shared/detections.record
INFO:tensorflow:Processed 0 images...
Traceback (most recent call last):
 File "object_detection/metrics/offline_eval_map_corloc.py", line 173, in <module>
     tf.app.run(main)
 File "/home/chrza/anaconda2/envs/tf27/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
     _sys.exit(main(_sys.argv[:1] + flags_passthrough))
 File "object_detection/metrics/offline_eval_map_corloc.py", line 166, in main
      metrics = read_data_and_evaluate(input_config, eval_config)
 File "object_detection/metrics/offline_eval_map_corloc.py", line 124, in read_data_and_evaluate
     decoded_dict)
 File "/home/chrza/anaconda2/envs/tf27/lib/python2.7/site-packages/tensorflow/models/research/object_detection/utils/object_detection_evaluation.py", line 174, in add_single_ground_truth_image_info
    (groundtruth_dict[standard_fields.InputDataFields.groundtruth_difficult]
AttributeError: 'NoneType' object has no attribute 'size'

有什么提示吗?

【问题讨论】:

    标签: tensorflow object-detection object-detection-api


    【解决方案1】:

    我将它(暂时)修复如下:

    if (standard_fields.InputDataFields.groundtruth_difficult in groundtruth_dict.keys()) and groundtruth_dict[standard_fields.InputDataFields.groundtruth_difficult]: if groundtruth_dict[standard_fields.InputDataFields.groundtruth_difficult].size or not groundtruth_classes.size: groundtruth_difficult = groundtruth_dict[standard_fields.InputDataFields.groundtruth_difficult]

    代替

    中的现有行(195-198)

    object_detection/metrutils/object_detection_evaluation.py

    这个错误是因为即使在没有通过难度标志的情况下,也会检查对象的大小。

    如果您在 tf 记录中跳过该参数,则会出现错误。

    也许这是开发人员的意图,但文档的清晰度肯定还有很多不足之处。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-22
      • 2018-07-22
      • 2020-06-18
      • 1970-01-01
      • 1970-01-01
      • 2018-08-07
      • 2020-08-23
      • 2020-03-04
      相关资源
      最近更新 更多