ATC模型转换时报错:E89999 op[MatMul_1529/PadD], 0th input has wrong shape0, it should be 1
2023/05/22
526
问题信息
问题来源 | 产品大类 | 产品子类 | 关键字 |
---|---|---|---|
官方 | 模型推理 | 模型转换 | ATC模型转换 |
问题现象描述
- 适用处理器:昇腾310P3 AI处理器
- 问题现象:
当CANN软件包版本为6.0.1时,执行ATC模型转换时报E89999 op[MatMul_1529/PadD], 0th input has wrong shape0, it should be 1错误信息。
原因分析
查看/root/ascend/log日志发现matmul算子融合失败,融合规则为BatchMatMulReduceMeanFusionPass。
网络中存在2个问题,relu多输出,batch_matmul是add的第2个输入,当前融合规则未考虑此种场景。
解决措施
关闭BatchMatMulReduceMeanFusionPass融合规则。
- 使用vi命令创建fusion_switch.cfg文件并输入以下内容。
{ "Switch":{ "GraphFusion":{ "BatchMatMulReduceMeanFusionPass":"off" }, } }
- 执行ATC模型转换前使用以下命令关闭融合规则。
--fusion_switch_file=pwd/fustion_swtich.cfg
本页内容