# 模型调用Pad接口填充报错For ‘Pad’, output buffer memset failed.

**1 系统环境**

硬件环境\(Ascend/GPU/CPU\): Ascend/GPU/CPU

MindSpore版本: mindformer =2.1.0

执行模式（PyNative/ Graph）: 不限

Python版本: Python=3.10

操作系统平台: Ubuntu18.04

**2 报错信息**

2.1 脚本信息

```
import mindspore
from mindspore import Tensor, nn, ops
import numpy as np
class TestNet(nn.Cell):
    def __init__(self):
        super(Net, self).__init__()
        self.pad = nn.Pad(paddings=((0, 0), (0, 999999)))
    def construct(self, x):
        return self.pad(x)
x =  Tensor(np.random.randn(9999, 9999))
pad = TestNet()
output = pad(x)
```

2.2 报错信息

该报错在开启Padding的Conv2d，DepthwiseConv2d，MaxPooling，AveragePooling等多个算子执行时均会出现。

```
For ‘Pad’, output buffer memset failed.
```

**3 根因分析**

参数设置过大,显存不足,无法执行.

**4 解决方案**

降低参数值

```
import mindspore
from mindspore import Tensor, nn, ops
import numpy as np
class TestNet(nn.Cell):
    def __init__(self):
        super(Net, self).__init__()
        self.pad = nn.Pad(paddings=((0, 0), (0, 99)))
    def construct(self, x):
        return self.pad(x)
x =  Tensor(np.random.randn(99, 99))
pad = TestNet()
output = pad(x)
```

