ssd_mobilenet_v1 tf模型转onnx模型之后hb_mapper checher报错

用户您好,请详细描述您所遇到的问题。

1.硬件获取渠道:企业采购

2.当前系统镜像版本:ai_toolchain_centos_7_j5:v1.1.7

3.当前天工开物版本:-

4.问题定位:ssd_mobilenet_v1 tf模型转onnx模型之后,使用hb_mapper checher检查模型报错

2022-08-26 10:30:25,858 file: hb_mapper.py func: hb_mapper line No: 73 Start hb_mapper…

2022-08-26 10:30:25,858 file: hb_mapper.py func: hb_mapper line No: 74 log will be stored in /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/09_qiupeng_test_model/forzen_inference_graph/mapper/hb_mapper_checker.log

2022-08-26 10:30:25,858 file: hb_mapper.py func: hb_mapper line No: 75 hbdk version 3.29.2

2022-08-26 10:30:25,858 file: hb_mapper.py func: hb_mapper line No: 76 horizon_nn version 0.13.6

2022-08-26 10:30:25,858 file: hb_mapper.py func: hb_mapper line No: 77 hb_mapper version 1.7.4

2022-08-26 10:30:25,925 file: helper.py func: helper line No: 124 Model input names: [‘image_tensor:0’]

2022-08-26 10:30:25,933 file: hb_mapper_checker.py func: hb_mapper_checker line No: 104 Model type: onnx

2022-08-26 10:30:25,933 file: hb_mapper_checker.py func: hb_mapper_checker line No: 105 march: bayes

2022-08-26 10:30:25,933 file: hb_mapper_checker.py func: hb_mapper_checker line No: 110 input names

2022-08-26 10:30:25,933 file: hb_mapper_checker.py func: hb_mapper_checker line No: 111 input shapes {}

2022-08-26 10:30:25,933 file: hb_mapper_checker.py func: hb_mapper_checker line No: 117 Begin model checking…

2022-08-26 10:30:25,933 file: build.py func: build line No: 36 [Fri Aug 26 10:30:25 2022] Start to Horizon NN Model Convert.

2022-08-26 10:30:25,933 file: dict_parser.py func: dict_parser line No: 28 The input parameter is not specified, convert with default parameters.

2022-08-26 10:30:25,934 file: dict_parser.py func: dict_parser line No: 518 Parsing the hbdk parameter:{‘hbdk_pass_through_params’: ‘–O0’}

2022-08-26 10:30:25,934 file: build.py func: build line No: 145 HorizonNN version: 0.13.6

2022-08-26 10:30:25,934 file: build.py func: build line No: 149 HBDK version: 3.29.2

2022-08-26 10:30:25,934 file: build.py func: build line No: 36 [Fri Aug 26 10:30:25 2022] Start to parse the onnx model.

2022-08-26 10:30:25,988 file: onnx_parser.py func: onnx_parser line No: 189 Input ONNX model infomation:

ONNX IR version: 5

Opset version: 10

Producer: tf2onnx1.10.1 a37f29

Domain: none

Input name: image_tensor:0, [1, 300, 300, 3]

Output name: …_boxes:0, [0, 0, 4]

Output name: …scores:0, [0, 0]

Output name: …lasses:0, [0, 0]

Output name: …ctions:0, [0]

2022-08-26 10:30:26,576 file: build.py func: build line No: 39 [Fri Aug 26 10:30:26 2022] End to parse the onnx model.

2022-08-26 10:30:26,587 file: build.py func: build line No: 268 Model input names: [‘image_tensor:0’]

2022-08-26 10:30:26,721 file: build.py func: build line No: 535 Saving the original float model: ./.hb_check/original_float_model.onnx.

2022-08-26 10:30:26,723 file: build.py func: build line No: 36 [Fri Aug 26 10:30:26 2022] Start to optimize the model.

2022-08-26 10:30:27,069 file: tool_utils.py func: tool_utils line No: 116 exception in command: checker

2022-08-26 10:30:27,071 file: tool_utils.py func: tool_utils line No: 117 Traceback (most recent call last):

File “/usr/local/lib/python3.6/site-packages/horizon_tc_ui/utils/tool_utils.py”, line 114, in __decorator

func(*args, **kargs)

File “/usr/local/lib/python3.6/site-packages/horizon_tc_ui/hb_mapper.py”, line 87, in checker

input_shape).run(__version__)

File “/usr/local/lib/python3.6/site-packages/horizon_tc_ui/hb_mapper_checker.py”, line 131, in run

**addtional_param)

File “/usr/local/lib/python3.6/site-packages/horizon_nn/build.py”, line 908, in check_onnx

return builder.build_model(original_model, save_model)

File “/usr/local/lib/python3.6/site-packages/horizon_nn/build.py”, line 541, in build_model

optimized_model = self.optimize_model(original_model)

File “/usr/local/lib/python3.6/site-packages/horizon_nn/build.py”, line 383, in optimize_model

self.node_dict)

File “/usr/local/lib/python3.6/site-packages/horizon_nn/horizon_onnx/quantizer.py”, line 189, in optimize

optimized_model_str = C.optimize(model_str, march, node_dict)

RuntimeError: There is an error in pass:constant_folding. Error message:Shape inference error(s): (op_type:Identity, node name: sub_graph_ending_node_Identity__52): [TypeInferenceError] Input 0 expected to have type but instead is null

(op_type:Gather, node name: Gather__60): [TypeInferenceError] Input 0 expected to have type but instead is null

2022-08-26 10:30:27,071 file: tool_utils.py func: tool_utils line No: 118 There is an error in pass:constant_folding. Error message:Shape inference error(s): (op_type:Identity, node name: sub_graph_ending_node_Identity__52): [TypeInferenceError] Input 0 expected to have type but instead is null

(op_type:Gather, node name: Gather__60): [TypeInferenceError] Input 0 expected to have type but instead is null

2022-08-26 10:30:27,071 file: build.py func: build line No: 39 [Fri Aug 26 10:30:27 2022] End to optimize the model.

2022-08-26 10:30:27,072 file: build.py func: build line No: 39 [Fri Aug 26 10:30:27 2022] End to Horizon NN Model Convert.

您好,建议您更换成OE1.1.19版本进行尝试哈,J5客户可以找我们地平线专门和您对接的工作人员进行支持。