From 6ccd031b92d89f868c0a4d72ba7b0813e18bdb4f Mon Sep 17 00:00:00 2001 From: lyuwenyu Date: Fri, 1 Dec 2023 08:35:37 +0000 Subject: [PATCH 1/2] fix channel maper init --- ppdet/modeling/necks/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ppdet/modeling/necks/__init__.py b/ppdet/modeling/necks/__init__.py index afd2a954545..4507954c93b 100644 --- a/ppdet/modeling/necks/__init__.py +++ b/ppdet/modeling/necks/__init__.py @@ -24,6 +24,7 @@ from . import custom_pan from . import dilated_encoder from . import clrnet_fpn +from . import channel_mapper from .fpn import * from .yolo_fpn import * @@ -39,3 +40,4 @@ from .dilated_encoder import * from .channel_mapper import * from .clrnet_fpn import * +from .channel_mapper import * From a2cba8a0e03b87620154c75db4bb567f97434487 Mon Sep 17 00:00:00 2001 From: lyuwenyu Date: Fri, 1 Dec 2023 09:33:19 +0000 Subject: [PATCH 2/2] update --- ppdet/modeling/necks/channel_mapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppdet/modeling/necks/channel_mapper.py b/ppdet/modeling/necks/channel_mapper.py index 6eff3f85476..67779346ab4 100644 --- a/ppdet/modeling/necks/channel_mapper.py +++ b/ppdet/modeling/necks/channel_mapper.py @@ -116,7 +116,7 @@ def out_shape(self): def init_weights(self): """Initialize the transformer weights.""" for p in self.parameters(): - if p.rank() > 1: + if p.dim() > 1: xavier_uniform_(p) if hasattr(p, 'bias') and p.bias is not None: constant_(p.bais)