Upload model
Browse files- config.json +2 -4
- modeling_efficientnet.py +1 -0
config.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "./efficientnet/temp",
|
| 3 |
"architectures": [
|
| 4 |
-
"
|
| 5 |
],
|
| 6 |
"auto_map": {
|
| 7 |
"AutoConfig": "configuration_efficientnet.EfficientNetConfig",
|
| 8 |
-
"AutoModel": "modeling_efficientnet.EfficientNetModel"
|
| 9 |
-
"AutoModelForImageClassification": "modeling_efficientnet.EfficientNetModelForImageClassification"
|
| 10 |
},
|
| 11 |
"model_name": "efficientnet_b0",
|
| 12 |
"model_type": "efficientnet",
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
+
"EfficientNetModel"
|
| 4 |
],
|
| 5 |
"auto_map": {
|
| 6 |
"AutoConfig": "configuration_efficientnet.EfficientNetConfig",
|
| 7 |
+
"AutoModel": "modeling_efficientnet.EfficientNetModel"
|
|
|
|
| 8 |
},
|
| 9 |
"model_name": "efficientnet_b0",
|
| 10 |
"model_type": "efficientnet",
|
modeling_efficientnet.py
CHANGED
|
@@ -31,6 +31,7 @@ class EfficientNetModelForImageClassification(PreTrainedModel):
|
|
| 31 |
|
| 32 |
def forward(self, pixel_values, labels=None):
|
| 33 |
logits = self.model(pixel_values)
|
|
|
|
| 34 |
if labels is not None:
|
| 35 |
loss = nn.CrossEntropyLoss(logits, labels)
|
| 36 |
return ImageClassifierOutputWithNoAttention(
|
|
|
|
| 31 |
|
| 32 |
def forward(self, pixel_values, labels=None):
|
| 33 |
logits = self.model(pixel_values)
|
| 34 |
+
loss = None
|
| 35 |
if labels is not None:
|
| 36 |
loss = nn.CrossEntropyLoss(logits, labels)
|
| 37 |
return ImageClassifierOutputWithNoAttention(
|