From 464885e13553bc8b74cf255c20c96624b05d8222 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Mon, 2 Dec 2024 16:55:29 -0800 Subject: [PATCH] See if we can avoid some model / layer pickle issues with the aa attr in ConvNormAct --- timm/layers/conv_bn_act.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/timm/layers/conv_bn_act.py b/timm/layers/conv_bn_act.py index 73ad670562..64edf54a3c 100644 --- a/timm/layers/conv_bn_act.py +++ b/timm/layers/conv_bn_act.py @@ -82,7 +82,8 @@ def out_channels(self): def forward(self, x): x = self.conv(x) x = self.bn(x) - if self.aa is not None: + aa = getattr(self, 'aa', None) + if aa is not None: x = self.aa(x) return x