From 2048f6f20f5f0b124601b2ed83e31abfbbcf5003 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Fri, 11 Aug 2023 13:45:06 +0900 Subject: [PATCH] set self.num_features to neck_chans if neck_chans > 0 --- timm/models/vision_transformer_sam.py | 1 + 1 file changed, 1 insertion(+) diff --git a/timm/models/vision_transformer_sam.py b/timm/models/vision_transformer_sam.py index c561ea1b22..9beb7b0162 100644 --- a/timm/models/vision_transformer_sam.py +++ b/timm/models/vision_transformer_sam.py @@ -434,6 +434,7 @@ def __init__( ), LayerNorm2d(neck_chans), ) + self.num_features = neck_chans else: self.neck = nn.Identity() neck_chans = embed_dim