专栏算法工具链生成的onnx模型,在ai_toolchain中模型check时报错:Segmentation fault

生成的onnx模型,在ai_toolchain中模型check时报错:Segmentation fault

Demeanour2023-09-15
33
7

使用的OE包版本为1.52a(J5),完整打印内容如下:

cd $(dirname $0)

config_file="./condlane_config.yaml"

model_type="onnx"

# build model

hb_mapper makertbin --config ${config_file} \

--model-type ${model_type}

2023-09-15 09:47:57,617 INFO log will be stored in /data/horizon_j5_open_explorer_v1.1.52a-py38_20230605/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/condlane/mapper/hb_mapper_makertbin.log

2023-09-15 09:47:57,617 INFO Start hb_mapper....

2023-09-15 09:47:57,617 INFO hbdk version 3.45.3

2023-09-15 09:47:57,617 INFO horizon_nn version 0.18.3

2023-09-15 09:47:57,617 INFO hb_mapper version 1.17.5

2023-09-15 09:47:57,617 INFO Start Model Convert....

2023-09-15 09:47:58,371 INFO Using onnx model file: /data/horizon_j5_open_explorer_v1.1.52a-py38_20230605/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/condlane/mapper/epoch_15_sim.onnx

2023-09-15 09:47:58,401 INFO Model has 1 inputs according to model file

2023-09-15 09:47:58,401 INFO Model name not given in yaml_file, using model name from model file: ['input.1']

2023-09-15 09:47:58,401 INFO Model input shape not given in yaml_file, using shape from model file: [[1, 3, 320, 800]]

2023-09-15 09:47:58,401 INFO nv12 input type rt received.

2023-09-15 09:47:58,401 INFO The calibration dir name suffix is the same as the value float32 of the cal_data_type parameter and will be read with the value of cal_data_type.

2023-09-15 09:47:58,401 INFO custom_op does not exist, skipped

2023-09-15 09:47:58,402 WARNING Input node input.1's input_source not set, it will be set to pyramid by default

2023-09-15 09:47:58,403 INFO *******************************************

2023-09-15 09:47:58,403 INFO First calibration picture name: 00a25f5b1300de890582e29ff6cc7335.rgb

2023-09-15 09:47:58,404 INFO First calibration picture md5:

d9ba862d2407638b42361c9291498b9b /data/horizon_j5_open_explorer_v1.1.52a-py38_20230605/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/condlane/mapper/calibration_data_rgb_f32/00a25f5b1300de890582e29ff6cc7335.rgb

2023-09-15 09:47:58,751 INFO *******************************************

2023-09-15 09:48:20,795 INFO [Fri Sep 15 09:48:20 2023] Start to Horizon NN Model Convert.

2023-09-15 09:48:20,795 INFO Loading horizon_nn debug methods:[]

2023-09-15 09:48:20,796 INFO Parsing the input parameter:{'input.1': {'input_shape': [1, 3, 320, 800], 'expected_input_type': 'YUV444_128', 'original_input_type': 'RGB', 'original_input_layout': 'NCHW', 'scales': array([1.], dtype=float32)}}

2023-09-15 09:48:20,796 INFO Parsing the calibration parameter

2023-09-15 09:48:20,796 INFO Parsing the hbdk parameter:{'hbdk_pass_through_params': '--O3 --core-num 1 --fast ', 'input-source': {'input.1': 'pyramid', '_default_value': 'ddr'}}

2023-09-15 09:48:20,796 INFO HorizonNN version: 0.18.3

2023-09-15 09:48:20,796 INFO HBDK version: 3.45.3

2023-09-15 09:48:20,796 INFO [Fri Sep 15 09:48:20 2023] Start to parse the onnx model.

2023-09-15 09:48:20,939 INFO Input ONNX model infomation:

ONNX IR version: 7

Opset version: [11, 1]

Producer: pytorch1.10

Domain: none

Input name: input.1, [1, 3, 320, 800]

Output name: 468, [20, 50, 14]

Output name: 2806, [1, 11, 40, 100]

Output name: 2330, [1, 11, 40, 100]

Output name: 2818, [11, 2, 40]

Output name: 1244, [11, 1]

2023-09-15 09:48:21,023 INFO [Fri Sep 15 09:48:21 2023] End to parse the onnx model.

2023-09-15 09:48:21,024 INFO Model input names parsed from model: ['input.1']

2023-09-15 09:48:21,024 INFO Create a preprocessing operator for input_name input.1 with means=None, std=[1.], original_input_layout=NCHW, color convert from 'RGB' to 'YUV_BT601_FULL_RANGE'.

2023-09-15 09:48:21,740 INFO Saving the original float model: condlane_original_float_model.onnx.

2023-09-15 09:48:21,743 INFO [Fri Sep 15 09:48:21 2023] Start to optimize the model.

03_build.sh: line 16: 3624 Segmentation fault (core dumped) hb_mapper makertbin --config ${config_file} --model-type ${model_type}

浏览之前的帖子,感觉应该也是包含不支持的算子?请问有没有开源的查验算子的相关工具呢?

onnx文件网盘链接如下:

链接: https://pan.baidu.com/s/1h2zW5Wl6IeN04jK-yy9XhQ?pwd=v68y 提取码: v68y

算法工具链
评论4
0/1000
  • 颜值即正义
    Lv.2

    你好,报错原因是模型中存在不支持的算子约束,如下图:

    2023-09-15
    0
    1
    • Demeanour回复颜值即正义:

      好的,谢谢!

      2023-09-15
      0
  • yy1234
    Lv.2

    非官方 我的经验是,更新oe包及对应的docker,先check,你的打印已经是build的步骤了,build是check成功后量化编译。不过你这个模型check时肯定也是到Start to optimize the model这儿.就Segmentation fault了,我也遇到过挺多次。要检查onnx模型的合法性,在onnx runtime==1.2.0版本下看能否正常推理,onnx simplify能否正常简化,如果都可以的话,去check应该就没问题了

    2023-09-15
    0
    1
    • Demeanour回复yy1234:

      好的,感谢,我去试一下

      2023-09-15
      0
  • 颜值即正义
    Lv.2

    你好,使用patch版本的horizon-nn,替换docker中原生的horizon-nn,可以获得具体的报错算子情况。获取途径如下:https://pan.horizon.ai/index.php/s/tg5CRsdZYTziZA6

    2023-09-15
    0
    1
    • 颜值即正义回复颜值即正义:

      修改完模型后直接用patch版本的工具再进行验证

      2023-09-15
      0
  • 颜值即正义
    Lv.2
    您好,地平线工具链在持续迭代优化,为了给您提供更好的服务,希望您能抽出3分钟左右的时间,将您在使用工具链期间的感受和建议告诉我们,您的宝贵意见对我们很重要,非常感谢!
    问卷链接:地平线算法工具链使用满意度反馈
    2023-09-15
    0
    0