Update glam_efficientnet_model.py
Browse files
glam_efficientnet_model.py
CHANGED
|
@@ -6,6 +6,7 @@ from typing import Optional, Union
|
|
| 6 |
|
| 7 |
from glam_module import GLAM
|
| 8 |
from swin_module import SwinWindowAttention
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
class GLAMEfficientNetConfig:
|
|
@@ -34,7 +35,8 @@ class GLAMEfficientNetForClassification(nn.Module):
|
|
| 34 |
|
| 35 |
# β
1) Torchvision EfficientNet Backbone
|
| 36 |
efficientnet = models.efficientnet_b0(pretrained=False) # No Hugging Face!
|
| 37 |
-
self.features = efficientnet
|
|
|
|
| 38 |
|
| 39 |
# β
1x1 conv for channel adjustment
|
| 40 |
self.conv1x1 = nn.Conv2d(1280, config.embed_dim, kernel_size=1)
|
|
|
|
| 6 |
|
| 7 |
from glam_module import GLAM
|
| 8 |
from swin_module import SwinWindowAttention
|
| 9 |
+
from transformers import EfficientNetModel
|
| 10 |
|
| 11 |
|
| 12 |
class GLAMEfficientNetConfig:
|
|
|
|
| 35 |
|
| 36 |
# β
1) Torchvision EfficientNet Backbone
|
| 37 |
efficientnet = models.efficientnet_b0(pretrained=False) # No Hugging Face!
|
| 38 |
+
self.features = EfficientNetModel.from_pretrained("google/efficientnet-b0")
|
| 39 |
+
|
| 40 |
|
| 41 |
# β
1x1 conv for channel adjustment
|
| 42 |
self.conv1x1 = nn.Conv2d(1280, config.embed_dim, kernel_size=1)
|