From f591e90b0d4896561143ba47fe62b92f3804ad68 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Thu, 29 Oct 2020 15:33:47 -0700 Subject: [PATCH] Make sure num_features attr is present in vit models as with others --- timm/models/vision_transformer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/vision_transformer.py b/timm/models/vision_transformer.py index 042efc05..32acccf3 100644 --- a/timm/models/vision_transformer.py +++ b/timm/models/vision_transformer.py @@ -206,7 +206,7 @@ class VisionTransformer(nn.Module): drop_path_rate=0., hybrid_backbone=None, norm_layer=nn.LayerNorm): super().__init__() self.num_classes = num_classes - self.embed_dim = embed_dim + self.num_features = self.embed_dim = embed_dim # num_features for consistency with other models if hybrid_backbone is not None: self.patch_embed = HybridEmbed(