量化后的onnx模型转成om模型失败
收藏回复举报
量化后的onnx模型转成om模型失败
t('forum.solved') 已解决
新人帖
发表于2025-04-19 21:10:20
0 查看

使用atc工具,将量化后的rt-detr模型转化为om模型失败。
atc --model=rtdetr-l_deploy_model.onnx --framework=5 --output=rtdetr-deploy --input_shape="images:1,3,640,640" --soc_version=Ascend310B1 --insert_op_conf=aipp.cfg

量化后的模型在onnxruntime环境里运行没有出现问题,但是使用atc转化om模型失败。

报错:

ATC run failed, Please check the detail log, Try 'atc --help' for more information
E61001: [PID: 447629] 2025-04-19-20:47:26.685.802 In op [fix_pipe], [fix_pipe does not support single op compilation!]
        TraceBack (most recent call last):
        Failed to compile Op [/model.28/decoder/dec_score_head.5/MatMulfunction_graph_224//model.28/decoder/dec_score_head.5/MatMul_pass.2,[/model.28/decoder/dec_score_head.5/MatMul.dequant,/model.28/decoder/dec_score_head.5/MatMul.dequant]]. (oppath: [Compile /usr/local/Ascend/ascend-toolkit/8.0.RC3.20/opp/built-in/op_impl/ai_core/tbe/impl/fix_pipe.py failed with errormsg/stack: File "/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/tbe/common/utils/errormgr/error_manager_vector.py", line 284, in raise_err_specific_reson
    raise RuntimeError(args_dict, msg)
RuntimeError: ({'errCode': 'E61001', 'op_name': 'fix_pipe', 'reason': 'fix_pipe does not support single op compilation!'}, 'In op [fix_pipe], [fix_pipe does not support single op compilation!]')
], optype: [FixPipe])
        Compile op[/model.28/decoder/dec_score_head.5/MatMulfunction_graph_224//model.28/decoder/dec_score_head.5/MatMul_pass.2,[/model.28/decoder/dec_score_head.5/MatMul.dequant,/model.28/decoder/dec_score_head.5/MatMul.dequant]] failed, oppath[/usr/local/Ascend/ascend-toolkit/8.0.RC3.20/opp/built-in/op_impl/ai_core/tbe/impl/fix_pipe.py], optype[FixPipe], taskID[2119]. Please check op's compilation error message.[FUNC:ReportBuildErrMessage][FILE:fusion_manager.cc][LINE:367]
        [SubGraphOpt][Compile][ProcFailedCompTask] Thread[255084533238368] recompile single op[/model.28/decoder/dec_score_head.5/MatMulfunction_graph_224//model.28/decoder/dec_score_head.5/MatMul_pass.2] failed[FUNC:ProcessAllFailedCompileTasks][FILE:tbe_op_store_adapter.cc][LINE:1069]
        [SubGraphOpt][Compile][ParalCompOp] Thread[255084533238368] process fail task failed[FUNC:ParallelCompileOp][FILE:tbe_op_store_adapter.cc][LINE:1116]
        [SubGraphOpt][Compile][CompOpOnly] CompileOp failed.[FUNC:CompileOpOnly][FILE:op_compiler.cc][LINE:1190]
        [GraphOpt][FusedGraph][RunCompile] Failed to compile graph with compiler Normal mode Op Compiler[FUNC:SubGraphCompile][FILE:fe_graph_optimizer.cc][LINE:1410]
        Call OptimizeFusedGraph failed, ret:4294967295, engine_name:AIcoreEngine, graph_name:partition0_rank443_new_sub_graph1214[FUNC:OptimizeSubGraph][FILE:graph_optimize.cc][LINE:119]
        subgraph 442 optimize failed[FUNC:OptimizeSubGraphWithMultiThreads][FILE:graph_manager.cc][LINE:815]
        build graph failed, graph id:0, ret:4294967295[FUNC:BuildModelWithGraphId][FILE:ge_generator.cc][LINE:1618]
        GenerateOfflineModel execute failed.

这是aipp.cfg的内容:

aipp_op{
    aipp_mode:static
    input_format : YUV420SP_U8
    src_image_size_w : 640
    src_image_size_h : 640

    csc_switch : true
    rbuv_swap_switch : false
    matrix_r0c0 : 256
    matrix_r0c1 : 0
    matrix_r0c2 : 359
    matrix_r1c0 : 256
    matrix_r1c1 : -88
    matrix_r1c2 : -183
    matrix_r2c0 : 256
    matrix_r2c1 : 454
    matrix_r2c2 : 0
    input_bias_0 : 0
    input_bias_1 : 128
    input_bias_2 : 128

    crop: true
    load_start_pos_h : 0
    load_start_pos_w : 0
    crop_size_w : 640
    crop_size_h : 640

    min_chn_0 : 0
    min_chn_1 : 0
    min_chn_2 : 0
    var_reci_chn_0: 0.0039215686274509803921568627451
    var_reci_chn_1: 0.0039215686274509803921568627451
    var_reci_chn_2: 0.0039215686274509803921568627451
}

量化过程参考:

均匀量化-手工量化-量化-AMCT(ONNX)-模型压缩AMCT工具-训练&推理开发-开发工具-CANN商用版8.0.RC3开发文档-昇腾社区

我要发帖子