Added fixes in config, preprocessor and modeling
Browse files- config.json +5 -4
- configuration_musheff.py +1 -1
- modeling.py +0 -4
- preprocessor_config.json +23 -10
config.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
{
|
| 2 |
"_name_or_path": "blasisd/musheff",
|
| 3 |
"architectures": ["Musheff"],
|
| 4 |
-
"
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
"model_type": "efficientnet_b3"
|
| 8 |
},
|
|
|
|
|
|
|
| 9 |
"num_classes": 12,
|
| 10 |
"label2id": {
|
| 11 |
"Agaricus_bisporus_edible": "0",
|
|
|
|
| 1 |
{
|
| 2 |
"_name_or_path": "blasisd/musheff",
|
| 3 |
"architectures": ["Musheff"],
|
| 4 |
+
"auto_map": {
|
| 5 |
+
"AutoConfig": "configuration_musheff.MusheffConfig",
|
| 6 |
+
"AutoModelForImageClassification": "modeling.Musheff"
|
|
|
|
| 7 |
},
|
| 8 |
+
"dropout_rate": 0.3,
|
| 9 |
+
"model_type": "efficientnet_b3",
|
| 10 |
"num_classes": 12,
|
| 11 |
"label2id": {
|
| 12 |
"Agaricus_bisporus_edible": "0",
|
configuration_musheff.py
CHANGED
|
@@ -3,7 +3,7 @@ from transformers import PretrainedConfig
|
|
| 3 |
|
| 4 |
|
| 5 |
class MusheffConfig(PretrainedConfig):
|
| 6 |
-
model_type = "
|
| 7 |
|
| 8 |
def __init__(self, num_classes=12, dropout_rate=0.3, **kwargs):
|
| 9 |
self.num_classes = num_classes
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
class MusheffConfig(PretrainedConfig):
|
| 6 |
+
model_type = "efficientnet_b3"
|
| 7 |
|
| 8 |
def __init__(self, num_classes=12, dropout_rate=0.3, **kwargs):
|
| 9 |
self.num_classes = num_classes
|
modeling.py
CHANGED
|
@@ -30,7 +30,3 @@ class Musheff(PreTrainedModel):
|
|
| 30 |
|
| 31 |
def forward(self, x):
|
| 32 |
return self.model(x)
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
AutoConfig.register("musheff", MusheffConfig)
|
| 36 |
-
AutoModel.register(MusheffConfig, Musheff)
|
|
|
|
| 30 |
|
| 31 |
def forward(self, x):
|
| 32 |
return self.model(x)
|
|
|
|
|
|
|
|
|
|
|
|
preprocessor_config.json
CHANGED
|
@@ -1,16 +1,29 @@
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
"do_resize": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"size": {
|
| 4 |
-
"height": 320,
|
| 5 |
-
"width": 320
|
| 6 |
-
},
|
| 7 |
-
"resample": 3,
|
| 8 |
-
"do_center_crop": true,
|
| 9 |
-
"crop_size": {
|
| 10 |
"height": 300,
|
| 11 |
"width": 300
|
| 12 |
-
}
|
| 13 |
-
"do_normalize": true,
|
| 14 |
-
"image_mean": [0.485, 0.456, 0.406],
|
| 15 |
-
"image_std": [0.229, 0.224, 0.225]
|
| 16 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"crop_size": {
|
| 3 |
+
"height": 289,
|
| 4 |
+
"width": 289
|
| 5 |
+
},
|
| 6 |
+
"do_center_crop": false,
|
| 7 |
+
"do_normalize": true,
|
| 8 |
+
"do_rescale": true,
|
| 9 |
"do_resize": true,
|
| 10 |
+
"image_mean": [
|
| 11 |
+
0.485,
|
| 12 |
+
0.456,
|
| 13 |
+
0.406
|
| 14 |
+
],
|
| 15 |
+
"image_processor_type": "EfficientNetImageProcessor",
|
| 16 |
+
"image_std": [
|
| 17 |
+
0.47853944,
|
| 18 |
+
0.4732864,
|
| 19 |
+
0.47434163
|
| 20 |
+
],
|
| 21 |
+
"include_top": true,
|
| 22 |
+
"resample": 0,
|
| 23 |
+
"rescale_factor": 0.00392156862745098,
|
| 24 |
+
"rescale_offset": false,
|
| 25 |
"size": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
"height": 300,
|
| 27 |
"width": 300
|
| 28 |
+
}
|
|
|
|
|
|
|
|
|
|
| 29 |
}
|