Skip to content

Commit 7df00a6

Browse files
committed
Fix SETR export bug
1 parent 2bff95e commit 7df00a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddleseg/models/backbones/vision_transformer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def __init__(self,
103103
self.proj_drop = nn.Dropout(proj_drop)
104104

105105
def forward(self, x):
106-
N, C = x.shape[1:]
106+
x_shape = paddle.shape(x)
107+
N, C = x_shape[1], x_shape[2]
107108
qkv = self.qkv(x).reshape((-1, N, 3, self.num_heads,
108109
C // self.num_heads)).transpose((2, 0, 3, 1,
109110
4))

0 commit comments

Comments
 (0)