---
title: 使用Atlas 200/300/500 推理产品或Atlas 训练系列产品时，VPC调用失败-昇腾社区
description: VPC模块调用失败，查看日志是否有类似日志信息中的报错信息。
keywords: VPC,抠图,失败,调用失败
url: https://www.hiascend.com/document/caselibrary/detail/topic_0000001372530585
section: (其他)
---

# 使用Atlas 200/300/500 推理产品或Atlas 训练系列产品时，VPC调用失败-昇腾社区

URL: https://www.hiascend.com/document/caselibrary/detail/topic_0000001372530585
描述: VPC模块调用失败，查看日志是否有类似日志信息中的报错信息。
关键词: VPC,抠图,失败,调用失败

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

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

使用Atlas 200/300/500 推理产品或Atlas 训练系列产品时，VPC调用失败

使用Atlas 200/300/500 推理产品或Atlas 训练系列产品时，VPC调用失败

2024/12/18

638

问题信息

| 问题来源 | 产品大类 | 关键字 |
| --- | --- | ---|
| 官方 | 模型推理 | VPC、抠图、失败、调用失败 |

#### 问题现象描述

VPC模块调用失败，查看日志是否有类似日志信息中的报错信息。

- 日志信息（1）：

```
RoiNum(0), inputArea rightOffset is 1918, it should be odd!
```

- 日志信息（2）：

```
Output bufferSize(65536) should not be smaller than widthStride(256) * heightStride(256) * 3 / 2 = 98304
```

- 日志信息（3）：

```
Input widthStride(300) is not right, it should be 16 algined!
```

```
Input widthStride(16) is not right, it should not be smaller than 32!
```

- 日志信息（4）：

```
bareDataAddr(0xaaaadeccdcd0), bareDataBufferSize(3133440) should be allocated by acldvppMalloc!
```

- 日志信息（5）：

```
Both RoiNum(1) outputAddr(0xaaaadeccdcd0) and first roi outputAddr(0xffff00002000) should be allocated by acldvppMalloc!
```

- 日志信息（6）：

```
RoiNum(0): inputConfigure cropArea, leftOffset(26) should be smaller than rightOffset(25)!
```

```
RoiNum(0): inputConfigure cropArea, upOffset(80) should be smaller than downOffset(79)!
```

```
RoiNum(0): inputConfigure cropArea, cropWidth(1931) should not be bigger than width(1920)!
```

```
RoiNum(0): inputConfigure cropArea, cropHeight(1270) should not be bigger than height(1088)!
```

```
RoiNum(0): inputConfigure cropArea, cropWidth(9) should be between [10, 8192]!
```

```
RoiNum(0): inputConfigure cropArea, cropHeight(4) should be between [6, 8192]!
```

```
RoiNum(0): inputConfigure cropArea, rightOffset(1921) should be smaller than width(1920)!
```

```
RoiNum(0): inputConfigure cropArea, downOffset(1089) should be smaller than height(1088)!
```

- 日志信息（7）：

```
RoiNum(0): scale must be in [1/32, 16], cropWidth(1920), pasteWidth(10)!
```

```
RoiNum(0): scale must be in [1/32, 16], cropHeight(6), pasteHeight(100)!
```

#### 原因分析

针对上面日志信息分析，可能存在以下对应原因：

- 日志信息（1）：VPC抠图区域右偏移坐标需是奇数，日志信息里1918是偶数，不符合要求。
- 日志信息（2）：当输出内存大小应该大于等于宽stride*高stride*3/2，日志信息显示不满足这个条件。

- 日志信息（3）：输入图片的宽stride（即每行图像占用的内存大小）必须是16倍数、且最小值32。日志信息里宽stride是300，不满足16倍数的要求，需要将图像做对齐后，并将宽stride设置成对齐后的值。
- 日志信息（4）：VPC的输入内存需要使用acldvppMalloc接口申请。
- 日志信息（5）：VPC的输出内存需要使用acldvppMalloc接口申请。
- 日志信息（6）：VPC的抠图区域不符合约束要求，因此报错。
- 日志信息（7）：VPC的缩放范围为[1/32, 16]。日志信息提示了缩放范围，并且显示了抠图宽为1920，输出区域的宽为10，通过计算可以得到：10/1920 &lt; 1/32，因此报错。

#### 解决措施

定位思路

1. 根据日志描述的错误信息，找到VPC对应的配置参数，根据提示进行修改。

2. 根据日志描述的错误信息，参考《应用软件开发指南 (C&amp;C++) [了解详情](https://www.hiascend.com/document/detail/zh/canncommercial/80RC3/apiref/appdevgapi/aclcppdevg_03_0337.html)》中VPC参数的约束修改。

根据提示的错误信息进行修改：

如果为日志信息（1），说明输入图片抠图区域的右偏移错误，应该设置为奇数。

如果为日志信息（2），说明输入内存的大小不正确，应该检查申请输入内存的代码，申请内存大小应该为1920*1088*3/2，并且bareDataBufferSize这个值也要填写为1920*1088*3/2。

如果为日志信息（3），说明输入图片的stride值不符合要求，需设置为16的倍数。

如果为日志信息（4）和日志信息（5），代码中申请内存时，需要使用acldvppMalloc接口申请。

如果为日志信息（6），需要修改抠图宽度。

如果为日志信息（7），需要修改缩放范围。


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