资源
MindSDK 模型推理报错Dtype不匹配:The input of the model does not match

MindSDK 模型推理报错Dtype不匹配:The input of the model does not match

2025/01/07

494

No rating yet
Rate This Document

问题信息

问题来源产品大类产品子类关键字
官方模型推理Vision SDKDtype不匹配

问题现象描述

MindSDK模型推理报错Dtype不匹配,提示“The input of the model does not match”,如图1所示。

图1 The input of the model does not match

原因分析

MindSDK图片内容保存的数据类型为int8,模型转换未加aipp,将fp32的输入转换成int8。

排查方法

使用netron查看模型是否带aipp,模型输入是否是fp32。

解决措施

添加AIPP信息重新转换OM文件。

模型转换脚本示例:

atc --model=./yolov3_tf.pb
--framework=3
--output=./yolov3_tf_bs1_fp16
--soc_version=Ascendxxx
--output_type=FP32--insert_op_conf=./aipp_yolov3_416_416.aippconfig
--input_shape="input:1,416,416,3" \

aipp config文件示例:

aipp_op {aipp_mode : static
related_input_rank : 0
input_format : YUV420SP_U8
src_image_size_w : 416
src_image_size_h : 416
crop : false
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
var_reci_chn_0 : 0.0039216
var_reci_chn_1 : 0.0039216
var_reci_chn_2 : 0.0039216
}

本页内容