diff --git a/ppdet/modeling/backbones/swin_transformer.py b/ppdet/modeling/backbones/swin_transformer.py index 8ee8bd66a9e2aafa0bcc50ac19f1cad6a1cbc767..73da7958f0422d3f0e4156a8dda938eedbc12def 100644 --- a/ppdet/modeling/backbones/swin_transformer.py +++ b/ppdet/modeling/backbones/swin_transformer.py @@ -537,7 +537,7 @@ class PatchEmbed(nn.Layer): B, C, H, W = x.shape # assert [H, W] == self.img_size[:2], "Input image size ({H}*{W}) doesn't match model ({}*{}).".format(H, W, self.img_size[0], self.img_size[1]) if W % self.patch_size[1] != 0: - x = F.pad(x, [0, self.patch_size[1] - W % self.patch_size[1]]) + x = F.pad(x, [0, self.patch_size[1] - W % self.patch_size[1], 0, 0]) if H % self.patch_size[0] != 0: x = F.pad(x, [0, 0, 0, self.patch_size[0] - H % self.patch_size[0]])