---
title: MindSDK 模型推理报错Dtype不匹配：The input of the model does not match-昇腾社区
description: MindSDK模型推理报错Dtype不匹配，提示“The input of the model does not match”，如图1所示。
keywords: Dtype不匹配
url: https://www.hiascend.com/document/caselibrary/detail/case_9461
section: (其他)
---

# MindSDK 模型推理报错Dtype不匹配：The input of the model does not match-昇腾社区

URL: https://www.hiascend.com/document/caselibrary/detail/case_9461
描述: MindSDK模型推理报错Dtype不匹配，提示“The input of the model does not match”，如图1所示。
关键词: Dtype不匹配

昇腾文档 [了解详情](https://www.hiascend.com/document)

故障案例 [了解详情](https://www.hiascend.com/document/caselibrary)

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

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

2025/01/07

766

问题信息

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

#### 问题现象描述

MindSDK模型推理报错Dtype不匹配，提示“The input of the model does not match”，如图1 [了解详情](https://www.hiascend.com/#ZH-CN_TOPIC_0000001668306376__fig1833316279)所示。

图1The 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
}
```

本页内容

- 问题信息
- 问题现象描述
- 原因分析
- 排查方法
- 解决措施
