From 5de2544a8025fbf2f71d4a33b384e2a59de32c76 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 10:49:34 -0800 Subject: [PATCH 01/24] Update metaformers.py --- timm/models/metaformers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index d96d6de9..4e63c1b8 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -536,6 +536,7 @@ class Mlp(nn.Module): self.drop2 = nn.Dropout(drop_probs[1]) def forward(self, x): + print(x) x = self.fc1(x) x = self.act(x) x = self.drop1(x) From bfa6f0962d5b1bfcfe166bf829da2bf64c0cdbbd Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 10:56:03 -0800 Subject: [PATCH 02/24] Update metaformers.py --- timm/models/metaformers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 5b7f7ce3..679d7ed6 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -536,7 +536,6 @@ class Mlp(nn.Module): self.drop2 = nn.Dropout(drop_probs[1]) def forward(self, x): - print(x) x = self.fc1(x) x = self.act(x) x = self.drop1(x) From 09d1ea628dab41011ebe9bf72f699e60ddf9d295 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 10:58:07 -0800 Subject: [PATCH 03/24] Update metaformers.py --- timm/models/metaformers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 679d7ed6..ce5e99d3 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -363,7 +363,7 @@ class RandomMixing(nn.Module): x = x.reshape(B, H, W, C) return x - +''' class LayerNormGeneral(nn.Module): r""" General LayerNorm for different situations. @@ -462,7 +462,7 @@ class LayerNormGeneral(nn.Module): if self.use_bias: x = x + self.bias return x -''' + class SepConv(nn.Module): r""" Inverted separable convolution from MobileNetV2: https://arxiv.org/abs/1801.04381. From 473403d9059a9153722b53d1f9d3e72e7720b93c Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 11:00:25 -0800 Subject: [PATCH 04/24] Update metaformers.py --- timm/models/metaformers.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index ce5e99d3..7632c69a 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -216,7 +216,7 @@ cfgs_v2 = generate_default_cfgs({ url='https://huggingface.co/sail/dl/resolve/main/caformer/caformer_b36_in21k.pth', num_classes=21841), }) - +''' class Downsampling(nn.Module): """ Downsampling implemented by a layer of convolution. @@ -255,15 +255,15 @@ class Downsampling(nn.Module): self.post_norm = post_norm(out_channels) if post_norm else nn.Identity() def forward(self, x): - print(x.shape) + #print(x.shape) x = self.pre_norm(x) - print(x.shape) + #print(x.shape) x = self.conv(x) - print(x.shape) + #print(x.shape) x = self.post_norm(x.permute(0, 2, 3, 1)).permute(0, 3, 1, 2) - print(x.shape) + #print(x.shape) return x -''' + class Scale(nn.Module): """ Scale vector by element multiplications. @@ -363,7 +363,7 @@ class RandomMixing(nn.Module): x = x.reshape(B, H, W, C) return x -''' + class LayerNormGeneral(nn.Module): r""" General LayerNorm for different situations. @@ -462,7 +462,7 @@ class LayerNormGeneral(nn.Module): if self.use_bias: x = x + self.bias return x - +''' class SepConv(nn.Module): r""" Inverted separable convolution from MobileNetV2: https://arxiv.org/abs/1801.04381. From 13876ada4c9dfe099bd5388e9660bf7bbdc82ef2 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 11:05:30 -0800 Subject: [PATCH 05/24] Update metaformers.py --- timm/models/metaformers.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 7632c69a..a5fffab9 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -216,7 +216,7 @@ cfgs_v2 = generate_default_cfgs({ url='https://huggingface.co/sail/dl/resolve/main/caformer/caformer_b36_in21k.pth', num_classes=21841), }) -''' + class Downsampling(nn.Module): """ Downsampling implemented by a layer of convolution. @@ -255,15 +255,15 @@ class Downsampling(nn.Module): self.post_norm = post_norm(out_channels) if post_norm else nn.Identity() def forward(self, x): - #print(x.shape) + print(x.shape) x = self.pre_norm(x) - #print(x.shape) + print(x.shape) x = self.conv(x) - #print(x.shape) + print(x.shape) x = self.post_norm(x.permute(0, 2, 3, 1)).permute(0, 3, 1, 2) - #print(x.shape) + print(x.shape) return x - +''' class Scale(nn.Module): """ Scale vector by element multiplications. @@ -612,8 +612,9 @@ class MetaFormerBlock(nn.Module): if res_scale_init_value else nn.Identity() def forward(self, x): - B, C, H, W = x.shape - x = x.view(B, H, W, C) + #B, C, H, W = x.shape + #x = x.view(B, H, W, C) + x = x.permute(0, 2, 3, 1) x = self.res_scale1(x) + \ self.layer_scale1( self.drop_path1( @@ -626,7 +627,8 @@ class MetaFormerBlock(nn.Module): self.mlp(self.norm2(x)) ) ) - x = x.view(B, C, H, W) + #x = x.view(B, C, H, W) + x = x.permute(0, 3, 1, 2) return x class MetaFormer(nn.Module): From 9bf9d163bc9231212ff1a3c4c520e7fd949cefaa Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 11:08:25 -0800 Subject: [PATCH 06/24] Update metaformers.py --- timm/models/metaformers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index a5fffab9..b7435128 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -832,6 +832,7 @@ def checkpoint_filter_fn(state_dict, model): import re out_dict = {} for k, v in state_dict.items(): + ''' k = k.replace('proj', 'conv') k = re.sub(r'layer_scale_([0-9]+)', r'layer_scale\1.scale', k) k = k.replace('network.1', 'downsample_layers.1') @@ -841,6 +842,7 @@ def checkpoint_filter_fn(state_dict, model): k = k.replace('network.4', 'network.2') k = k.replace('network.6', 'network.3') k = k.replace('network', 'stages') + ''' k = re.sub(r'downsample_layers.([0-9]+)', r'stages.\1.downsample', k) k = re.sub(r'([0-9]+).([0-9]+)', r'\1.blocks.\2', k) k = k.replace('stages.0.downsample', 'patch_embed') From bee9576f03f483a269e917da075d96c92faf35f1 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 11:11:19 -0800 Subject: [PATCH 07/24] Update metaformers.py --- timm/models/metaformers.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index b7435128..d5bf9692 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -809,11 +809,12 @@ class MetaFormer(nn.Module): if pre_logits: return x - x = self.global_pool(x) - x = x.squeeze() - x = self.norm(x) + #x = self.global_pool(x) + #x = x.squeeze() + #x = self.norm(x) # (B, H, W, C) -> (B, C) - x = self.head(x) + #x = self.head(x) + x=self.head(self.norm(x.mean([1, 2]))) return x def forward_features(self, x): From 808f4a7ebd5ffa0e951e22e9636f1bbb6a01730c Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 11:13:14 -0800 Subject: [PATCH 08/24] Update metaformers.py --- timm/models/metaformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index d5bf9692..1356c769 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -814,7 +814,7 @@ class MetaFormer(nn.Module): #x = self.norm(x) # (B, H, W, C) -> (B, C) #x = self.head(x) - x=self.head(self.norm(x.mean([1, 2]))) + x=self.head(self.norm(x.mean([2, 3]))) return x def forward_features(self, x): From 6b6510f30ab8d153f6fb47d1a3af6f21272d66f1 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 11:49:10 -0800 Subject: [PATCH 09/24] Update metaformers.py --- timm/models/metaformers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 1356c769..5608b368 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -819,7 +819,10 @@ class MetaFormer(nn.Module): def forward_features(self, x): x = self.patch_embed(x) - x = self.stages(x) + #x = self.stages(x) + for i, stage in enumerate(self.stages): + x=stage(x) + print(x) return x From 2fef9006d72824789b733dd8dbc20b21b79add0b Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 11:56:52 -0800 Subject: [PATCH 10/24] Update metaformers.py --- timm/models/metaformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 5608b368..a074d3fe 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -822,7 +822,7 @@ class MetaFormer(nn.Module): #x = self.stages(x) for i, stage in enumerate(self.stages): x=stage(x) - print(x) + print(x[0]) return x From cf28c57fda98ffc26d462f92c07532733ea97645 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 11:58:27 -0800 Subject: [PATCH 11/24] Update metaformers.py --- timm/models/metaformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index a074d3fe..9ae7701f 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -822,7 +822,7 @@ class MetaFormer(nn.Module): #x = self.stages(x) for i, stage in enumerate(self.stages): x=stage(x) - print(x[0]) + print(x[0][0][0][0]) return x From 3f0b07536764c47af42290a218a15097b5cec1a0 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:00:17 -0800 Subject: [PATCH 12/24] Update metaformers.py --- timm/models/metaformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 9ae7701f..27964167 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -822,7 +822,7 @@ class MetaFormer(nn.Module): #x = self.stages(x) for i, stage in enumerate(self.stages): x=stage(x) - print(x[0][0][0][0]) + #print(x[0][0][0][0]) return x From 4ed934e00068be576881a87d5218b355ca01a6be Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:14:45 -0800 Subject: [PATCH 13/24] Update metaformers.py --- timm/models/metaformers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 27964167..dc83c185 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -819,11 +819,13 @@ class MetaFormer(nn.Module): def forward_features(self, x): x = self.patch_embed(x) + print('timm') #x = self.stages(x) + ''' for i, stage in enumerate(self.stages): x=stage(x) #print(x[0][0][0][0]) - + ''' return x From 32bede4e279ee1027a63d5b55591153e53c209ec Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:18:20 -0800 Subject: [PATCH 14/24] Update metaformers.py --- timm/models/metaformers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index dc83c185..87018b47 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -809,12 +809,12 @@ class MetaFormer(nn.Module): if pre_logits: return x - #x = self.global_pool(x) - #x = x.squeeze() - #x = self.norm(x) + x = self.global_pool(x) + x = x.squeeze() + x = self.norm(x) # (B, H, W, C) -> (B, C) - #x = self.head(x) - x=self.head(self.norm(x.mean([2, 3]))) + x = self.head(x) + #x=self.head(self.norm(x.mean([2, 3]))) return x def forward_features(self, x): From 2209d0830eed9b87149df4a1f25f65da46d47f4b Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:20:54 -0800 Subject: [PATCH 15/24] Update metaformers.py --- timm/models/metaformers.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 87018b47..733d05c9 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -536,6 +536,7 @@ class Mlp(nn.Module): self.drop2 = nn.Dropout(drop_probs[1]) def forward(self, x): + print(x) x = self.fc1(x) x = self.act(x) x = self.drop1(x) @@ -612,9 +613,8 @@ class MetaFormerBlock(nn.Module): if res_scale_init_value else nn.Identity() def forward(self, x): - #B, C, H, W = x.shape - #x = x.view(B, H, W, C) - x = x.permute(0, 2, 3, 1) + B, C, H, W = x.shape + x = x.view(B, H, W, C) x = self.res_scale1(x) + \ self.layer_scale1( self.drop_path1( @@ -627,8 +627,7 @@ class MetaFormerBlock(nn.Module): self.mlp(self.norm2(x)) ) ) - #x = x.view(B, C, H, W) - x = x.permute(0, 3, 1, 2) + x = x.view(B, C, H, W) return x class MetaFormer(nn.Module): @@ -814,31 +813,25 @@ class MetaFormer(nn.Module): x = self.norm(x) # (B, H, W, C) -> (B, C) x = self.head(x) - #x=self.head(self.norm(x.mean([2, 3]))) return x def forward_features(self, x): x = self.patch_embed(x) - print('timm') - #x = self.stages(x) - ''' - for i, stage in enumerate(self.stages): - x=stage(x) - #print(x[0][0][0][0]) - ''' + x = self.stages(x) + return x def forward(self, x): x = self.forward_features(x) x = self.forward_head(x) + print('timm') return x def checkpoint_filter_fn(state_dict, model): import re out_dict = {} for k, v in state_dict.items(): - ''' k = k.replace('proj', 'conv') k = re.sub(r'layer_scale_([0-9]+)', r'layer_scale\1.scale', k) k = k.replace('network.1', 'downsample_layers.1') @@ -848,7 +841,6 @@ def checkpoint_filter_fn(state_dict, model): k = k.replace('network.4', 'network.2') k = k.replace('network.6', 'network.3') k = k.replace('network', 'stages') - ''' k = re.sub(r'downsample_layers.([0-9]+)', r'stages.\1.downsample', k) k = re.sub(r'([0-9]+).([0-9]+)', r'\1.blocks.\2', k) k = k.replace('stages.0.downsample', 'patch_embed') From 1d882eb494caf5b5a3a1e9c7442d883e1707998e Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:22:29 -0800 Subject: [PATCH 16/24] Update metaformers.py --- timm/models/metaformers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 733d05c9..a108afda 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -536,7 +536,6 @@ class Mlp(nn.Module): self.drop2 = nn.Dropout(drop_probs[1]) def forward(self, x): - print(x) x = self.fc1(x) x = self.act(x) x = self.drop1(x) From 2916f37f8d862cd4fcbc86c858b23894daec3339 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:27:12 -0800 Subject: [PATCH 17/24] Update metaformers.py --- timm/models/metaformers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index a108afda..6f09dd74 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -816,8 +816,10 @@ class MetaFormer(nn.Module): def forward_features(self, x): x = self.patch_embed(x) - x = self.stages(x) - + #x = self.stages(x) + for i, stage in enumerate(self.stages): + x = stage(x) + print(x[0][0][0][0]) return x From e4f89b2e25064fb4368a83cc5bc2d916f6f3a2cf Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:33:31 -0800 Subject: [PATCH 18/24] Revert "Update metaformers.py" This reverts commit 2916f37f8d862cd4fcbc86c858b23894daec3339. --- timm/models/metaformers.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 6f09dd74..a108afda 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -816,10 +816,8 @@ class MetaFormer(nn.Module): def forward_features(self, x): x = self.patch_embed(x) - #x = self.stages(x) - for i, stage in enumerate(self.stages): - x = stage(x) - print(x[0][0][0][0]) + x = self.stages(x) + return x From 4f6bbbfb0e51260de5c68470aff7c69bc34e7b19 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:33:36 -0800 Subject: [PATCH 19/24] Revert "Update metaformers.py" This reverts commit 1d882eb494caf5b5a3a1e9c7442d883e1707998e. --- timm/models/metaformers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index a108afda..733d05c9 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -536,6 +536,7 @@ class Mlp(nn.Module): self.drop2 = nn.Dropout(drop_probs[1]) def forward(self, x): + print(x) x = self.fc1(x) x = self.act(x) x = self.drop1(x) From 2912d8c477c991ae6cf4d241e8feea613db6c7a2 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:33:44 -0800 Subject: [PATCH 20/24] Revert "Update metaformers.py" This reverts commit 2209d0830eed9b87149df4a1f25f65da46d47f4b. --- timm/models/metaformers.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 733d05c9..87018b47 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -536,7 +536,6 @@ class Mlp(nn.Module): self.drop2 = nn.Dropout(drop_probs[1]) def forward(self, x): - print(x) x = self.fc1(x) x = self.act(x) x = self.drop1(x) @@ -613,8 +612,9 @@ class MetaFormerBlock(nn.Module): if res_scale_init_value else nn.Identity() def forward(self, x): - B, C, H, W = x.shape - x = x.view(B, H, W, C) + #B, C, H, W = x.shape + #x = x.view(B, H, W, C) + x = x.permute(0, 2, 3, 1) x = self.res_scale1(x) + \ self.layer_scale1( self.drop_path1( @@ -627,7 +627,8 @@ class MetaFormerBlock(nn.Module): self.mlp(self.norm2(x)) ) ) - x = x.view(B, C, H, W) + #x = x.view(B, C, H, W) + x = x.permute(0, 3, 1, 2) return x class MetaFormer(nn.Module): @@ -813,25 +814,31 @@ class MetaFormer(nn.Module): x = self.norm(x) # (B, H, W, C) -> (B, C) x = self.head(x) + #x=self.head(self.norm(x.mean([2, 3]))) return x def forward_features(self, x): x = self.patch_embed(x) - x = self.stages(x) - + print('timm') + #x = self.stages(x) + ''' + for i, stage in enumerate(self.stages): + x=stage(x) + #print(x[0][0][0][0]) + ''' return x def forward(self, x): x = self.forward_features(x) x = self.forward_head(x) - print('timm') return x def checkpoint_filter_fn(state_dict, model): import re out_dict = {} for k, v in state_dict.items(): + ''' k = k.replace('proj', 'conv') k = re.sub(r'layer_scale_([0-9]+)', r'layer_scale\1.scale', k) k = k.replace('network.1', 'downsample_layers.1') @@ -841,6 +848,7 @@ def checkpoint_filter_fn(state_dict, model): k = k.replace('network.4', 'network.2') k = k.replace('network.6', 'network.3') k = k.replace('network', 'stages') + ''' k = re.sub(r'downsample_layers.([0-9]+)', r'stages.\1.downsample', k) k = re.sub(r'([0-9]+).([0-9]+)', r'\1.blocks.\2', k) k = k.replace('stages.0.downsample', 'patch_embed') From a1882204eab13f8bcb85ef226083e71a910b3605 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:33:51 -0800 Subject: [PATCH 21/24] Revert "Update metaformers.py" This reverts commit 32bede4e279ee1027a63d5b55591153e53c209ec. --- timm/models/metaformers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 87018b47..dc83c185 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -809,12 +809,12 @@ class MetaFormer(nn.Module): if pre_logits: return x - x = self.global_pool(x) - x = x.squeeze() - x = self.norm(x) + #x = self.global_pool(x) + #x = x.squeeze() + #x = self.norm(x) # (B, H, W, C) -> (B, C) - x = self.head(x) - #x=self.head(self.norm(x.mean([2, 3]))) + #x = self.head(x) + x=self.head(self.norm(x.mean([2, 3]))) return x def forward_features(self, x): From f985f35b9193a70fdef5ecb8cb9d8d9a5bdfcb2c Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:33:56 -0800 Subject: [PATCH 22/24] Revert "Update metaformers.py" This reverts commit 4ed934e00068be576881a87d5218b355ca01a6be. --- timm/models/metaformers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index dc83c185..27964167 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -819,13 +819,11 @@ class MetaFormer(nn.Module): def forward_features(self, x): x = self.patch_embed(x) - print('timm') #x = self.stages(x) - ''' for i, stage in enumerate(self.stages): x=stage(x) #print(x[0][0][0][0]) - ''' + return x From 869e01cec6b27285743d993106f741917ab0efe0 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:34:01 -0800 Subject: [PATCH 23/24] Revert "Update metaformers.py" This reverts commit 3f0b07536764c47af42290a218a15097b5cec1a0. --- timm/models/metaformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 27964167..9ae7701f 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -822,7 +822,7 @@ class MetaFormer(nn.Module): #x = self.stages(x) for i, stage in enumerate(self.stages): x=stage(x) - #print(x[0][0][0][0]) + print(x[0][0][0][0]) return x From 47b718a1c84d57455aa6f81f8a71152f4f6157a0 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Tue, 17 Jan 2023 12:34:29 -0800 Subject: [PATCH 24/24] Revert "Update metaformers.py" This reverts commit 2fef9006d72824789b733dd8dbc20b21b79add0b. --- timm/models/metaformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index 9ae7701f..5608b368 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -822,7 +822,7 @@ class MetaFormer(nn.Module): #x = self.stages(x) for i, stage in enumerate(self.stages): x=stage(x) - print(x[0][0][0][0]) + print(x) return x