From 1839105f27fa1bec53791f9311a1d38567baa308 Mon Sep 17 00:00:00 2001 From: littletomatodonkey <2120160898@bit.edu.cn> Date: Tue, 8 Dec 2020 18:47:46 +0800 Subject: [PATCH] fix resnest (#458) --- ppcls/modeling/architectures/resnest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ppcls/modeling/architectures/resnest.py b/ppcls/modeling/architectures/resnest.py index 4cd22563..84d0452a 100644 --- a/ppcls/modeling/architectures/resnest.py +++ b/ppcls/modeling/architectures/resnest.py @@ -90,7 +90,7 @@ class rSoftmax(nn.Layer): ]) x = paddle.transpose(x=x, perm=[0, 2, 1, 3]) x = nn.functional.softmax(x, axis=1) - x = paddle.reshape(x=x, shape=[batch, r * h * w]) + x = paddle.reshape(x=x, shape=[batch, r * h * w, 1, 1]) else: x = nn.functional.sigmoid(x) return x @@ -165,7 +165,6 @@ class SplatConv(nn.Layer): atten = self.conv3(gap) atten = self.rsoftmax(atten) - atten = paddle.unsqueeze(x=atten, axis=[2, 3]) if self.radix > 1: attens = paddle.split(atten, num_or_sections=self.radix, axis=1) -- GitLab