Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow TF对象检测API-计算评估措施失败_Tensorflow_Object Detection_Object Detection Api - Fatal编程技术网

Tensorflow TF对象检测API-计算评估措施失败

Tensorflow TF对象检测API-计算评估措施失败,tensorflow,object-detection,object-detection-api,Tensorflow,Object Detection,Object Detection Api,我在自己的数据集上成功地训练了一个模型,导出了推理图,并在测试数据集上进行了推理 我现在有 检测作为tfrecord文件,在输入配置中指定 具有指定度量集的eval_配置文件 当我尝试计算新对象检测器中的度量时,使用度量计算进行推理和评估 它返回此AttributeError: INFO:tensorflow:Processing file: /media/sf_shared/detections.record INFO:tensorflow:Processed 0 images... Tr

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

我现在有

  • 检测作为tfrecord文件,在输入配置中指定
  • 具有指定度量集的eval_配置文件
当我尝试计算新对象检测器中的度量时,使用度量计算进行推理和评估

它返回此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'
INFO:tensorflow:处理文件:/media/sf\u shared/detections.record
信息:tensorflow:已处理0个图像。。。
回溯(最近一次呼叫最后一次):
文件“object\u detection/metrics/offline\u eval\u map\u corloc.py”,第173行,在
tf.app.run(主)
文件“/home/chrza/anaconda2/envs/tf27/lib/python2.7/site packages/tensorflow/python/platform/app.py”,第48行,正在运行
_系统出口(主(_sys.argv[:1]+标志_passthrough))
文件“object\u detection/metrics/offline\u eval\u map\u corloc.py”,第166行,主目录
度量=读取数据和评估(输入配置、评估配置)
文件“object\u detection/metrics/offline\u eval\u map\u corloc.py”,第124行,在read\u data\u和\u evaluate中
解码(dict)
文件“/home/chrza/anaconda2/envs/tf27/lib/python2.7/site packages/tensorflow/models/research/object\u detection/utils/object\u detection\u evaluation.py”,第174行,位于add\u single\u ground\u truth\u image\u info中
(groundtruth目录[标准字段.输入数据字段.groundtruth目录]
AttributeError:“非类型”对象没有属性“大小”
有什么提示吗?

我(暂时)修复了它,如下所示:


如果(标准字段.InputDataFields.groundtruth在groundtruth目录下为困难字段)和groundtruth目录[标准字段.InputDataFields.groundtruth目录下为困难字段]:
如果groundtruth\u dict[标准字段.输入数据字段.groundtruth\u困难]。大小是否为groundtruth\u类。大小:
groundtruth\u困难=groundtruth\u dict[标准字段.输入数据字段.groundtruth\u困难]

取代现有线路(195-198)

object\u detection/metrutils/object\u detection\u evaluation.py

该错误是由于这样一个事实造成的,即即使在没有传递难度标志的情况下,也会检查对象的大小

如果在tf记录中跳过该参数,则这是一个错误

也许这是开发人员的意图,但文档的清晰性肯定还有很多需要改进的地方

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'