From 498b437b736e3c97baabafc3c6a58a69abf98037 Mon Sep 17 00:00:00 2001 From: Feng Ni Date: Fri, 11 Feb 2022 12:15:35 +0800 Subject: [PATCH] fix reid resnet bn export (#5168) --- ppdet/modeling/reid/resnet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ppdet/modeling/reid/resnet.py b/ppdet/modeling/reid/resnet.py index 968fe9774..2e2a85558 100644 --- a/ppdet/modeling/reid/resnet.py +++ b/ppdet/modeling/reid/resnet.py @@ -55,12 +55,14 @@ class ConvBNLayer(nn.Layer): bias_attr=False, data_format=data_format) - self._batch_norm = nn.BatchNorm( - num_filters, act=act, data_layout=data_format) + self._batch_norm = nn.BatchNorm2D(num_filters) + self.act = act def forward(self, inputs): y = self._conv(inputs) y = self._batch_norm(y) + if self.act: + y = getattr(F, self.act)(y) return y -- GitLab