专栏算法工具链hb_model_modifier删除dequantize节点,hb_model_modifier.log没有记录到删除dequantize节点的scale值

hb_model_modifier删除dequantize节点,hb_model_modifier.log没有记录到删除dequantize节点的scale值

XSXXH2023-09-19
54
5
1.芯片型号:J5等
2.天工开物开发包OpenExplorer版本:J5_OE_1.1.60
3.问题定位:hb_model_modifier.log没有记录到删除dequantize节点的scale值
4.问题具体描述:对build.sh生成的 xxxx.bin 进行hb_model_modifier model.bin -a Dequantize 删除模型尾部dequantize节点,hb_model_modifier.log没有记录到删除dequantize节点的scale值 。hb_model_modifier.log记录的内容如下(这是表明该dequantize节点无法被删除吗):2023-09-19 11:15:11,811 file: tool_utils.py func: tool_utils line No: 73 log will be stored in /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/07_segmentation/ufldv2_0919/mapper/model_output/hb_model_modifier.log

2023-09-19 11:15:13,452 file: hb_model_modifier.py func: hb_model_modifier line No: 390 storing info of model: ufldv2_tus18_0919_nv12.bin

2023-09-19 11:15:13,452 file: hb_model_modifier.py func: hb_model_modifier line No: 393 --------input----------

2023-09-19 11:15:13,452 file: hb_model_modifier.py func: hb_model_modifier line No: 395 name: "input"

type {

elem_type: INT8

dim: 1

dim: 320

dim: 800

dim: 3

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 396 --------output----------

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 398 name: "loc_row"

type {

elem_type: FLOAT

dim: 1

dim: 100

dim: 56

dim: 4

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 398 name: "loc_col"

type {

elem_type: FLOAT

dim: 1

dim: 100

dim: 41

dim: 4

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 398 name: "exist_row"

type {

elem_type: FLOAT

dim: 1

dim: 2

dim: 56

dim: 4

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 398 name: "exist_col"

type {

elem_type: FLOAT

dim: 1

dim: 2

dim: 41

dim: 4

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 399 --------value_info----------

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 401 name: "Gemm_51_nhwc2nchw_transposed_output0"

type {

elem_type: INT32

dim: 1

dim: 39576

dim: 1

dim: 1

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 401 name: "replaced_onnx::Slice_198"

type {

elem_type: FLOAT

dim: 1

dim: 39576

dim: 1

dim: 1

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 401 name: "onnx::Reshape_203_reshape"

type {

elem_type: FLOAT

dim: 1

dim: 22400

dim: 1

dim: 1

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 401 name: "onnx::Reshape_210_reshape"

type {

elem_type: FLOAT

dim: 1

dim: 16400

dim: 1

dim: 1

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 401 name: "onnx::Reshape_217_reshape"

type {

elem_type: FLOAT

dim: 1

dim: 448

dim: 1

dim: 1

}

2023-09-19 11:15:13,460 file: hb_model_modifier.py func: hb_model_modifier line No: 401 name: "onnx::Reshape_224_reshape"

type {

elem_type: FLOAT

dim: 1

dim: 328

dim: 1

dim: 1

}

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 402 --------node----------

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "input"

output: "Gemm_51_nhwc2nchw_transposed_output0"

name: "torch_jit_subgraph_0"

op_type: "BPU"

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "Gemm_51_nhwc2nchw_transposed_output0"

input: "Gemm_51_x_scale"

output: "replaced_onnx::Slice_198"

name: "replaced_onnx::Slice_198_HzDequantize"

op_type: "Dequantize"

attribute {

name: "num_args"

type: INT

i: 2

}

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "replaced_onnx::Slice_198"

input: "onnx::Slice_200"

input: "onnx::Slice_201"

input: "Slice_56_Slice_56_Slice_56_Slice_56_Slice_56_Slice_56_Slice_56_Slice_56_Slice_56_onnx::Slice_199_new_axes"

input: "onnx::Slice_199"

output: "onnx::Reshape_203_reshape"

name: "Slice_56"

op_type: "Slice"

attribute {

name: "num_args"

type: INT

i: 5

}

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "onnx::Reshape_203_reshape"

input: "Reshape_58_pos_shape_info"

output: "loc_row"

name: "Slice_56onnx::Reshape_203_Reshape_0"

op_type: "Reshape"

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "replaced_onnx::Slice_198"

input: "onnx::Slice_201"

input: "onnx::Slice_208"

input: "Slice_63_Slice_63_Slice_63_Slice_63_Slice_63_Slice_63_Slice_63_Slice_63_Slice_63_onnx::Slice_199_new_axes"

input: "onnx::Slice_199"

output: "onnx::Reshape_210_reshape"

name: "Slice_63"

op_type: "Slice"

attribute {

name: "num_args"

type: INT

i: 5

}

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "onnx::Reshape_210_reshape"

input: "Reshape_65_pos_shape_info"

output: "loc_col"

name: "Slice_63onnx::Reshape_210_Reshape_0"

op_type: "Reshape"

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "replaced_onnx::Slice_198"

input: "onnx::Slice_208"

input: "onnx::Slice_215"

input: "Slice_70_Slice_70_Slice_70_Slice_70_Slice_70_Slice_70_Slice_70_Slice_70_Slice_70_onnx::Slice_199_new_axes"

input: "onnx::Slice_199"

output: "onnx::Reshape_217_reshape"

name: "Slice_70"

op_type: "Slice"

attribute {

name: "num_args"

type: INT

i: 5

}

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "onnx::Reshape_217_reshape"

input: "Reshape_72_pos_shape_info"

output: "exist_row"

name: "Slice_70onnx::Reshape_217_Reshape_0"

op_type: "Reshape"

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "replaced_onnx::Slice_198"

input: "onnx::Slice_221"

input: "onnx::Slice_222"

input: "Slice_77_Slice_77_Slice_77_Slice_77_Slice_77_Slice_77_Slice_77_Slice_77_Slice_77_onnx::Slice_199_new_axes"

input: "onnx::Slice_199"

output: "onnx::Reshape_224_reshape"

name: "Slice_77"

op_type: "Slice"

attribute {

name: "num_args"

type: INT

i: 5

}

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 404 input: "onnx::Reshape_224_reshape"

input: "Reshape_79_pos_shape_info"

output: "exist_col"

name: "Slice_77onnx::Reshape_224_Reshape_0"

op_type: "Reshape"

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 405 --------input_type----------

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 407 7

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 408 --------input_layout----------

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 410 2

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 99 Tool will remove ['Dequantize'] nodes from this model

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 107 Nodes that will be removed from this model: ['replaced_onnx::Slice_198_HzDequantize']

2023-09-19 11:15:13,461 file: hb_model_modifier.py func: hb_model_modifier line No: 116 Node replaced_onnx::Slice_198_HzDequantize is not adjacent to input or output. It can not be removed! Skipped!

2023-09-19 11:15:17,721 file: hb_model_modifier.py func: hb_model_modifier line No: 129 modified model saved as ufldv2_tus18_0919_nv12_modified.bin

算法工具链
评论3
0/1000
  • 颜值即正义
    Lv.2
    你好,'replaced_onnx::Slice_198_HzDequantize'节点未紧挨着输入或输出,无法删除,所以也就没有记录对应的scale和zero_point信息
    2023-09-19
    0
    2
    • XSXXH回复颜值即正义:

      就是dequantize节点必须紧挨着output或者input,间隔了一个节点都不行,这意思把

      2023-09-19
      0
    • 颜值即正义回复XSXXH:

      对的

      2023-09-19
      0
  • XSXXH
    Lv.1

    估计是没靠近输入或者输出节点的原因

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