Open
Conversation
|
Yeah, I came across this issue too. I can confirm that this patch would fix the issue. I independently fixed it myself before I learnt of this PR though, so I include my own diff --git a/models/efficientformer.py b/models/efficientformer.py
index a379823..66e0c4e 100644
--- a/models/efficientformer.py
+++ b/models/efficientformer.py
@@ -10,9 +10,9 @@ from typing import Dict
import itertools
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
-from timm.models.layers import DropPath, trunc_normal_
+from timm.models.layers import DropPath, trunc_normal_, to_2tuple
from timm.models.registry import register_model
-from timm.models.layers.helpers import to_2tuple
+# from timm.models.layers.helpers import to_2tuple
EfficientFormer_width = {
'l1': [48, 96, 224, 448],
diff --git a/models/efficientformer_v2.py b/models/efficientformer_v2.py
index 48234a4..1f4fcde 100644
--- a/models/efficientformer_v2.py
+++ b/models/efficientformer_v2.py
@@ -11,9 +11,9 @@ from typing import Dict
import itertools
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
-from timm.models.layers import DropPath, trunc_normal_
+from timm.models.layers import DropPath, trunc_normal_, to_2tuple
from timm.models.registry import register_model
-from timm.models.layers.helpers import to_2tuple
+# from timm.models.layers.helpers import to_2tuple
EfficientFormer_width = {
'L': [40, 80, 192, 384], # 26m 83.3% 6attn
@@ -631,7 +631,7 @@ class EfficientFormerV2(nn.Module):
x = self.patch_embed(x)
x = self.forward_tokens(x)
if self.fork_feat:
- # otuput features of four stages for dense prediction
+ # output features of four stages for dense prediction
return x
# print(x.size())
x = self.norm(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to updates to the timm module after Oct 10, 2022 (available in version >= 0.9):
