专栏算法工具链【转发求助】EfficientDet目标检测算法onnx转换j3 bin文件失败

【转发求助】EfficientDet目标检测算法onnx转换j3 bin文件失败

已解决
十二日雨夜2024-09-09
64
6

在地平线官方提供的最新docker容器内部操作,对应软件包版本如下:

  1. 2022-10-31 11:49:36,138 INFO hbdk version 3.37.2

  2. 2022-10-31 11:49:36,139 INFO horizon_nn version 0.14.0

  3. 2022-10-31 11:49:36,139 INFO hb_mapper version 1.9.9

执行脚本内容如下:

  1. model_type="onnx"

  2. #onnx_model="/mnt/y/files/projects/horizon_model_conversion/effdet/models/input/trained_effdet_sim.onnx"

  3. onnx_model="./models/input/trained_effdet_sim.onnx"

  4. output="./logs/fcos_checker.log"

  5. march="bernoulli2"

  6. hb_mapper checker --model-type ${model_type} \

  7. --model ${onnx_model} \

  8. --output ${output} --march ${march}

错误信息如下:

2022-10-31 11:49:36,696 ERROR There is an error in pass:fuse_div_into_conv. Error message:/home/jenkins/workspace/model_convert/onnx/onnx/common/ir.h:1166: eraseOutput: Assertion `outputs_[i]->uses().empty()` failed.

完整的log日志:

2022-11-19 17:34:36,466 file: hb_mapper.py func: hb_mapper line No: 70 Start hb_mapper....
2022-11-19 17:34:36,466 file: hb_mapper.py func: hb_mapper line No: 71 log will be stored in /data//files/projects/horizon_model_conversion/effdet/hb_mapper_checker.log
2022-11-19 17:34:36,466 file: hb_mapper.py func: hb_mapper line No: 72 hbdk version 3.26.8
2022-11-19 17:34:36,466 file: hb_mapper.py func: hb_mapper line No: 73 horizon_nn version 0.12.5
2022-11-19 17:34:36,466 file: hb_mapper.py func: hb_mapper line No: 74 hb_mapper version 1.4.4
2022-11-19 17:34:36,466 file: hb_mapper.py func: hb_mapper line No: 76 parameter [output] is deprecated
2022-11-19 17:34:36,499 file: helper.py func: helper line No: 124 Model input names: ['input']
2022-11-19 17:34:36,501 file: hb_mapper_checker.py func: hb_mapper_checker line No: 104 Model type: onnx
2022-11-19 17:34:36,501 file: hb_mapper_checker.py func: hb_mapper_checker line No: 105 march: bernoulli2
2022-11-19 17:34:36,501 file: hb_mapper_checker.py func: hb_mapper_checker line No: 110 input names []
2022-11-19 17:34:36,501 file: hb_mapper_checker.py func: hb_mapper_checker line No: 111 input shapes {}
2022-11-19 17:34:36,501 file: hb_mapper_checker.py func: hb_mapper_checker line No: 117 Begin model checking....
2022-11-19 17:34:36,501 file: build.py func: build line No: 36 [Sat Nov 19 17:34:36 2022] Start to Horizon NN Model Convert.
2022-11-19 17:34:36,501 file: dict_parser.py func: dict_parser line No: 26 The input parameter is not specified, convert with default parameters.
2022-11-19 17:34:36,501 file: dict_parser.py func: dict_parser line No: 480 The hbdk parameter is not specified, and the submodel will be compiled with the default parameter.
2022-11-19 17:34:36,501 file: build.py func: build line No: 146 HorizonNN version: 0.12.5
2022-11-19 17:34:36,501 file: build.py func: build line No: 150 HBDK version: 3.26.8
2022-11-19 17:34:36,501 file: build.py func: build line No: 36 [Sat Nov 19 17:34:36 2022] Start to parse the onnx model.
2022-11-19 17:34:36,624 file: onnx_parser.py func: onnx_parser line No: 146 ONNX model info:
ONNX IR version:  6
Opset version:    11
Input name:       input, [1, 3, 300, 300]
2022-11-19 17:34:36,790 file: build.py func: build line No: 39 [Sat Nov 19 17:34:36 2022] End to parse the onnx model.
2022-11-19 17:34:36,796 file: build.py func: build line No: 263 Model input names: ['input']
2022-11-19 17:34:36,831 file: build.py func: build line No: 524 Saving the original float model: ./.hb_check/original_float_model.onnx.
2022-11-19 17:34:36,831 file: build.py func: build line No: 36 [Sat Nov 19 17:34:36 2022] Start to optimize the model.
2022-11-19 17:34:37,038 file: tool_utils.py func: tool_utils line No: 116 exception in command: checker
2022-11-19 17:34:37,039 file: tool_utils.py func: tool_utils line No: 117 Traceback (most recent call last):
  File "/data//anaconda3/envs/horizon_py3.6/lib/python3.6/site-packages/horizon_tc_ui/utils/tool_utils.py", line 114, in __decorator

    func(*args, **kargs)

  File "/data//anaconda3/envs/horizon_py3.6/lib/python3.6/site-packages/horizon_tc_ui/hb_mapper.py", line 84, in checker

    input_shape).run(__version__)

  File "/data//anaconda3/envs/horizon_py3.6/lib/python3.6/site-packages/horizon_tc_ui/hb_mapper_checker.py", line 131, in run

    **addtional_param)

  File "/data//anaconda3/envs/horizon_py3.6/lib/python3.6/site-packages/horizon_nn/build.py", line 900, in check_onnx
    return builder.build_model(original_model, save_model)
  File "/data//anaconda3/envs/horizon_py3.6/lib/python3.6/site-packages/horizon_nn/build.py", line 530, in build_model
    optimized_model = self.optimize_model(original_model)
  File "/data//anaconda3/envs/horizon_py3.6/lib/python3.6/site-packages/horizon_nn/build.py", line 379, in optimize_model
self.node_dict)
  File "/data//anaconda3/envs/horizon_py3.6/lib/python3.6/site-packages/horizon_nn/horizon_onnx/quantizer.py", line 185, in optimize
    optimized_model_str = C.optimize(model_str, march, node_dict)
RuntimeError: There is an error in pass:fuse_div_into_conv. Error message:/home/jenkins/workspace/model_convert/onnx/onnx/common/ir.h:1166: eraseOutput: Assertion `outputs_[i]->uses().empty()` failed.

2022-11-19 17:34:37,040 file: tool_utils.py func: tool_utils line No: 118 There is an error in pass:fuse_div_into_conv. Error message:/home/jenkins/workspace/model_convert/onnx/onnx/common/ir.h:1166: eraseOutput: Assertion `outputs_[i]->uses().empty()` failed.
2022-11-19 17:34:37,040 file: build.py func: build line No: 39 [Sat Nov 19 17:34:37 2022] End to optimize the model.
2022-11-19 17:34:37,040 file: build.py func: build line No: 39 [Sat Nov 19 17:34:37 2022] End to Horizon NN Model Convert.
onnx模型:某度网盘:https://pan.baidu.com/s/145OIk-LXzxsB6WtofVCLEQ;提取码:7r4h。
算法工具链
征程3
评论4
0/1000
  • kotei左文亮
    Lv.3

    转换j3的docker是哪个版本? 模型检查的时候有没有问题呢?

    2024-09-11
    0
    1
    • kkkkk回复kotei左文亮:

      你好,帖子中的问题因该是发生在模型check时,我也遇到了同样的问题,OE包版本是1.16.2,模型转为onnx后正常推理,使用j3工具链进行check时报的这个错误。

      2024-09-12
      0
  • Pipeline
    Lv.2

    是的,检查一下编译docker,这个报错跟onnxruntme的版本兼容是有关系的

    2024-09-11
    0
    1
    • kkkkk回复Pipeline:

      你好,请问具体是onnxruntime与哪个包的的兼容问题,与我本地转onnx模型的pytorch版本有关吗?

      2024-09-12
      0
  • kotei左文亮
    Lv.3

    此问题解决了没有啊?很可能是版本兼容问题,换个更高的版本,先使用模型检查看看有没有不支持的算子

    2024-09-19
    0
    0
  • kotei左文亮
    Lv.3

    客户您好,鉴于长时间未收到你的答复,我们暂将该问题做关闭处理,如您仍有相同问题,请在新的帖子中重新发起提问,祝您工作愉快

    2024-09-26
    0
    0