使用 ge 构图时,如果将一个 format 格式为 ND 的数据转换为 format 为 NCHW?
auto mul_147_2 = op::Muls("mul_147_2")
.set_input_x(mul_147, FORMAT_NCHW)
.set_attr_value(2.0);
graph.AddOp(mul_147_2);
auto trans = op::TransData("trans")
.set_input_src(mul_147_2)
.set_attr_src_format("ND")
.set_attr_dst_format("NCHW")
.set_attr_groups(1);
graph.AddOp(trans);
auto pooling = op::Pooling("pooling")
.set_input_x(trans, FORMAT_NCHW)
.set_attr_data_format("NCHW");
graph.AddOp(pooling);
这样构图执行完之后,貌似还是不行,执行会报错
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] OP(36800,python):2023-03-31-07:01:58.533.874 [nn_pooling_ops.cc:1118][OP_PROTO] PoolingInferShape:1118 OpName:[pooling] "[xFormat], has wrong format [2], it should be in NCHW, NHWC"
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.533.935 [op_desc.cc:1317]36800 CallInferFuncV1: ErrorNo: 4294967295(failed) [COMP][PRE_OPT][Call][InferFunc] for pooling failed. ret:4294967295
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.101 [infershape_pass.cc:120]36800 Infer: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Call][InferShapeAndType] for node:pooling(Pooling) failed
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.122 [infer_base_pass.cc:114]36800 InferAndUpdate: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Call][Infer] failed for node pooling, ret: 1343242270
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.128 [infer_base_pass.cc:71]36800 Run: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Call][InferAndUpdate] for node pooling failed! ret: 1343242270
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.141 [base_pass.cc:534]36800 RunPassesOnNode: ErrorNo: 1343225860(Internal errors) [COMP][PRE_OPT][Process][Pass] InferShapePass on node pooling failed, result 4294967295, the passes will be terminated immediately.
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.148 [base_pass.cc:485]36800 RunPassesNodeOnce: ErrorNo: 4294967295(failed) [COMP][PRE_OPT][Process][Passes] on node pooling type Pooling failed, error code:4294967295
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.153 [base_pass.cc:441]36800 RunPassesGraphRepass: ErrorNo: 4294967295(failed) [COMP][PRE_OPT][Process][Passes] on node pooling type Pooling failed, error code:4294967295
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.162 [graph_prepare.cc:2220]36800 InferShapeForPreprocess: ErrorNo: 4294967295(failed) [COMP][PRE_OPT][Run][GePasses] infershape for preprocess failed, ret:4294967295.
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.538.430 [graph_prepare.cc:1730]36800 FormatAndShapeProcess: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Call][InferShapeForPreprocess] Prepare Graph infershape failed
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.538.445 [graph_prepare.cc:1906]36800 PrepareDynShape: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Process][Prepare_FormatAndShapeProcess] failed
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.539.041 [graph_manager.cc:774]36800 PreRunOptimizeOriginalGraph: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Process][GraphManager_stages.preparer.PrepareDynShape] failed
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.539.048 [graph_manager.cc:3304]36800 OptimizeGraph: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Run][PreRunOptimizeOriginalGraph] failed for graph:dGraph_NPU, session_id:0
CANN 版本 6.0.1 ,芯片 910
使用 ge 构图时,如果将一个 format 格式为 ND 的数据转换为 format 为 NCHW?
auto mul_147_2 = op::Muls("mul_147_2")
.set_input_x(mul_147, FORMAT_NCHW)
.set_attr_value(2.0);
graph.AddOp(mul_147_2);
auto trans = op::TransData("trans")
.set_input_src(mul_147_2)
.set_attr_src_format("ND")
.set_attr_dst_format("NCHW")
.set_attr_groups(1);
graph.AddOp(trans);
auto pooling = op::Pooling("pooling")
.set_input_x(trans, FORMAT_NCHW)
.set_attr_data_format("NCHW");
graph.AddOp(pooling);
这样构图执行完之后,貌似还是不行,执行会报错
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] OP(36800,python):2023-03-31-07:01:58.533.874 [nn_pooling_ops.cc:1118][OP_PROTO] PoolingInferShape:1118 OpName:[pooling] "[xFormat], has wrong format [2], it should be in NCHW, NHWC"
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.533.935 [op_desc.cc:1317]36800 CallInferFuncV1: ErrorNo: 4294967295(failed) [COMP][PRE_OPT][Call][InferFunc] for pooling failed. ret:4294967295
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.101 [infershape_pass.cc:120]36800 Infer: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Call][InferShapeAndType] for node:pooling(Pooling) failed
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.122 [infer_base_pass.cc:114]36800 InferAndUpdate: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Call][Infer] failed for node pooling, ret: 1343242270
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.128 [infer_base_pass.cc:71]36800 Run: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Call][InferAndUpdate] for node pooling failed! ret: 1343242270
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.141 [base_pass.cc:534]36800 RunPassesOnNode: ErrorNo: 1343225860(Internal errors) [COMP][PRE_OPT][Process][Pass] InferShapePass on node pooling failed, result 4294967295, the passes will be terminated immediately.
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.148 [base_pass.cc:485]36800 RunPassesNodeOnce: ErrorNo: 4294967295(failed) [COMP][PRE_OPT][Process][Passes] on node pooling type Pooling failed, error code:4294967295
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.153 [base_pass.cc:441]36800 RunPassesGraphRepass: ErrorNo: 4294967295(failed) [COMP][PRE_OPT][Process][Passes] on node pooling type Pooling failed, error code:4294967295
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.534.162 [graph_prepare.cc:2220]36800 InferShapeForPreprocess: ErrorNo: 4294967295(failed) [COMP][PRE_OPT][Run][GePasses] infershape for preprocess failed, ret:4294967295.
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.538.430 [graph_prepare.cc:1730]36800 FormatAndShapeProcess: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Call][InferShapeForPreprocess] Prepare Graph infershape failed
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.538.445 [graph_prepare.cc:1906]36800 PrepareDynShape: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Process][Prepare_FormatAndShapeProcess] failed
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.539.041 [graph_manager.cc:774]36800 PreRunOptimizeOriginalGraph: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Process][GraphManager_stages.preparer.PrepareDynShape] failed
log/debug/plog/plog-36800_20230331070153280.log:[ERROR] GE(36800,python):2023-03-31-07:01:58.539.048 [graph_manager.cc:3304]36800 OptimizeGraph: ErrorNo: 1343242270(Prepare Graph infershape failed) [COMP][PRE_OPT][Run][PreRunOptimizeOriginalGraph] failed for graph:dGraph_NPU, session_id:0
CANN 版本 6.0.1 ,芯片 910