【功能模块】
在用Atlas200DK模型转换的时候出现了一些问题想请教一下,谢谢!
利用ATC进行模型转换的时候出现expand算子支持失败
【操作步骤&问题现象】
1、先将darknet版本的yolov4转换为onnx,再用atc将onnx转为om,atc转换失败
2、darknet转onnx脚本链接:https://gitee.com/ye-hanyu/pytorch-YOLOv4
3、atc转换命令:
atc --model=yolov4_1_3_608_608.onnx --framework=5 --output=yolov4-mihs-power --input_format=NCHW --log=error --soc_version=Ascend310 --input_shape="input:1,3,608,608" --out_nodes="Conv_388:0;Conv_404:0;Conv_420:0" --insert_op_conf=aipp.config
【问题】查看error级别日志,发现时expand算子出现错误,但我查看算子规格onnx是支持expand算子的
【软件版本:】
-- Pytorch: 1.8.1+cpu
-- Python 版本: Python 3.7.5
-- 操作系统版本:Ubuntu 18.04
-- CANN 版本:CANN 20.2.alpha001
-- 开发板卡: Atlas200 DK
【日志信息】(可选,上传日志内容或者附件)
出现错误如下:
ATC start working now, please wait for a moment. [EVENT] GE(64934,atc.bin):2021-04-05-10:21:47.402.389 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/init/gelib.cc:66]64934 Initialize:[GEPERFTRACE] GE Init Start [EVENT] FE(64934,atc.bin):2021-04-05-10:21:48.194.328 [../../../../../../fusion_engine/optimizer/fusion_config_manager/fusion_config_parser.cc:242]64934 ParseFusionConfigFile:"[FE_PERFORMANCE]The time cost of FusionConfigParser::ParseFusionConfigFile is [1009] micro second." [EVENT] FE(64934,atc.bin):2021-04-05-10:21:48.194.758 [../../../../../../fusion_engine/optimizer/fusion_config_manager/fusion_priority_manager.cc:79]64934 SortGraphFusion:"[FE_PERFORMANCE]The time cost of FusionPriorityManager::SortGraphFusion is [337] micro second." [EVENT] FE(64934,atc.bin):2021-04-05-10:21:48.194.872 [../../../../../../fusion_engine/optimizer/fusion_manager/fusion_manager.cc:222]64934 Initialize:"[FE_PERFORMANCE]The time cost of FusionManager::Initialize is [717393] micro second." [EVENT] GE(64934,atc.bin):2021-04-05-10:21:48.259.645 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/init/gelib.cc:102]64934 Initialize:[GEPERFTRACE] The time cost of GELib::Initialize is [857187] micro second. [EVENT] GE(64934,atc.bin):2021-04-05-10:21:48.704.847 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/manager/graph_manager.cc:781]64934 PreRun:PreRun start, graph node size 646, session id 0, graph id 0, graph name yolov4-mihs-power [EVENT] FE(64934,atc.bin):2021-04-05-10:21:48.707.626 [../../../../../../fusion_engine/optimizer/graph_optimizer/fe_graph_optimizer.cc:537]64934 OptimizeGraphPrepare:"[FE_PERFORMANCE]The time cost of FEGraphOptimizer::OptimizeTagNoConstFoldingGraph is [1684] micro second." [EVENT] GE(64934,atc.bin):2021-04-05-10:21:48.708.267 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/manager/graph_manager.cc:670]64934 PreRunOptimizeOriginalGraph:[GEPERFTRACE] The time cost of GraphManager::stages.optimizer.OptimizeOriginalGraphForQuantize is [2333] micro second. [EVENT] GE(64934,atc.bin):2021-04-05-10:21:48.708.452 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/manager/graph_manager.cc:671]64934 PreRunOptimizeOriginalGraph:[GEPERFTRACE] The time cost of GraphManager::stages.optimizer.HandleSummaryOp is [147] micro second. [ERROR] TBE(64934,atc.bin):2021-04-05-10:21:48.791.658 [/home/jenkins/agent/workspace/Compile_Canndev_Centos_X86/canndev/ops/built-in/op_proto/array_ops.cc:2235][OP_PROTO] ExpandInferShape:2235 OpName:[Expand_343] "Get constValue failed of [shape]" [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.791.699 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/metadef/graph/op_desc.cc:1345]64934 CallInferFunc: ErrorNo: -1(failed) Expand_343 call infer func. ret: 4294967295 [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.791.707 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/metadef/graph/shape_refiner.cc:768]64934 InferShapeAndType: ErrorNo: -1(failed) Expand_343 call infer function failed. [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.791.902 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/passes/infershape_pass.cc:41]64934 Run: ErrorNo: 1343242270(Prepare Graph infershape failed) infershape failed. node: Expand_343 [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.791.916 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/passes/base_pass.cc:88]64934 RunPasses: ErrorNo: 1343225860(Internal errors) Failed to process pass InferShapePass on node Expand_343, result 1343242270, the passes will be terminated immediately. [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.791.922 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/passes/base_pass.cc:216]64934 RunPassesOneGraph: ErrorNo: 1343242270(Prepare Graph infershape failed) Failed to process passes on node Expand_343 type Expand, error code: 1343242270 [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.791.993 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/preprocess/graph_preprocess.cc:1816]64934 InferShapeForPreprocess: ErrorNo: 1343242270(Prepare Graph infershape failed) Run ge_passes infershape for preprocess failed, ret:1343242270. [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.792.020 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/preprocess/graph_preprocess.cc:1407]64934 FormatAndShapeProcess: ErrorNo: 1343242270(Prepare Graph infershape failed) Prepare Graph infershape failed [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.792.037 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/preprocess/graph_preprocess.cc:1541]64934 PrepareDynShape: ErrorNo: 1343242270(Prepare Graph infershape failed) Failed to process Prepare_FormatAndShapeProcess [EVENT] GE(64934,atc.bin):2021-04-05-10:21:48.792.053 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/manager/graph_manager.cc:673]64934 PreRunOptimizeOriginalGraph:[GEPERFTRACE] The time cost of GraphManager::stages.preparer.PrepareDynShape is [83569] micro second. [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.792.070 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/manager/graph_manager.cc:673]64934 PreRunOptimizeOriginalGraph: ErrorNo: 1343242270(Prepare Graph infershape failed) Failed to process GraphManager_stages.preparer.PrepareDynShape [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.792.096 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/manager/graph_manager.cc:800]64934 PreRun: ErrorNo: 1343242270(Prepare Graph infershape failed) Run PreRunOptimizeOriginalGraph failed for graph:yolov4-mihs-power. [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.792.988 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/manager/graph_manager.cc:872]64934 StartForRunGraph: ErrorNo: 1343242270(Prepare Graph infershape failed) PreRun Failed. [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.793.014 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/graph/manager/graph_manager.cc:1244]64934 BuildGraph: ErrorNo: 1343242268(PreRun failed.) [BuildGraph] StartForRunGraph failed! [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.793.021 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/generator/ge_generator.cc:913]64934 BuildModel: ErrorNo: 1343266819(Graph manager build graph failed.) GraphManager build graph fail, graph id: 0 [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.793.040 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/generator/ge_generator.cc:565]64934 GenerateModel: ErrorNo: 1343266819(Graph manager build graph failed.) Build model failed. [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.793.303 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/offline/main.cc:1029]64934 GenerateModel: ErrorNo: -1(failed) GE GenerateOfflineModel execute failed [ERROR] GE(64934,atc.bin):2021-04-05-10:21:48.793.327 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_X86/graphengine/ge/offline/main.cc:1030]64934 GenerateModel: ErrorNo: -1(failed) ATC Generate execute failed [EVENT] FE(64934,atc.bin):2021-04-05-10:21:49.268.977 [../../../../../../fusion_engine/optimizer/fusion_manager/fusion_manager.cc:289]64934 Finalize:"[FE_PERFORMANCE]The time cost of FusionManager::Finalize is [468869] micro second." ATC run failed, Please check the detail log, Try 'atc --help' for more information
日志信息文件和模型参数等文件的链接如下:
链接:https://pan.baidu.com/s/1ultST_UNQLC2ZLpMHtaZmQ
提取码:tdbo