您好!
我和我的团队一直在使用 edgeeai-Benchmark 工具来编译自定义对象检测模型、以便与 SK-TDA4VM 电路板上的 EdgeAI 应用程序配合使用。 我们当前尝试使用效率检测点0的自定义模型作为对某些数据进行调整的基础。 我们使用基准工具(例如 efficentdet-lite0_Bifpn_maxpool2x2_Relu_ti-lite)成功编译并运行了从 modelzoo 提取的类似模型、与 modelzoo 上的 efficientdet 模型非常相似、我们在开始修整之前将模型的激活类型更改为 Relu。
将模型导出为丝墨格式并按照 github.com/.../custom_models.md 中的说明进行操作后、我们创建了以下管道配置设置、该设置使用 coco 作为输入和校准数据集:
'od-xxxx': utils.dict_update(common_cfg,
preprocess=preproc_transforms.get_transform_tflite((320, 320), (320, 320), backend='cv2'),
session=tflite_session_type(**utils.dict_update(tflite_session_cfg, input_mean=(127.0, 127.0, 127.0), input_scale=(1.0/128.0, 1.0/128.0, 1.0/128.0)),
runtime_options=utils.dict_update(runtime_options_tflite_np2, {'object_detection:meta_arch_type': 5, 'object_detection:meta_layers_names_list':f'{settings.models_path}/d0-lite_mod.prototxt'}),
model_path=f'{settings.models_path}/d0-lite_mod.tflite'),
postprocess=postproc_transforms.get_transform_detection_tflite( normalized_detections=False, ignore_index=0, resize_with_pad=False),
metric=dict(label_offset_pred=datasets.coco_det_label_offset_90to90(label_offset=0)),
model_info=dict(metric_reference={'accuracy_ap[.5:.95]%':31.57})
我们使用的 prototext 文件主要是 modelzoo prototex 的副本、唯一的变化是 TOP_k、检测阈值和输入尺寸值。 当尝试使用此配置编译模型时、会出现以下错误:
DIM Error - For Tensor 0, Dim 1 is 0
随后出现分段故障。 我们也会得到相同的尺寸误差、但它不是0、而是显示 Dim 1是一些较大的负数。
为了避免崩溃、我们通过删除元层名称列表选项修改了上述管道配置。 此修改确实允许脚本在不崩溃的情况下完成,但这样做会导致脚本自动生成元管道数据:
TIDL Meta PipeLine (Proto) File : Number of OD backbone nodes = 0 Size of odBackboneNodeIds = 0 Number of subgraphs:2 , 306 nodes delegated out of 363 nodes
这是不正确的、原因有很多(没有对任何 OD 主干节点进行计数、标识了2个子图、而不是每个节点委派)、而且毫不奇怪、推理计算的结果非常差:
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.000
对编译的模型进行封装并在电路板上运行会导致非常不连贯的帧速率、而不会检测到任何物体。 尝试使用效率为 det-lite1的模型作为基体执行相同的过程、但在推理过程中只检测到大量误报。 这些结果不受 SETTINGS 中配置的影响。YAML。
我们的 prototext 或流水线配置是否会导致尺寸误差或不良推理结果的缺失、或者问题是否出在我们的模型中以及 TIDL 工具如何解读?
谢谢、
Andrew
