registering directly ENC
Browse files
app.py
CHANGED
@@ -253,7 +253,7 @@ def predict_and_analyze(model_name, num_channels, dim, input_channel, image):
|
|
253 |
# EfficientNetConfig.model_type = "efficientnet_%s_planet_detection" % (hparams.num_channels)
|
254 |
# EfficientNetConfig.model_type = hparams.model_type
|
255 |
|
256 |
-
config.save_pretrained(save_directory=model_loading_name)
|
257 |
|
258 |
model = EfficientNet(dropout=hparams.dropout,
|
259 |
num_channels=hparams.num_channels,
|
@@ -263,8 +263,8 @@ def predict_and_analyze(model_name, num_channels, dim, input_channel, image):
|
|
263 |
width_mult=hparams.width_mult,
|
264 |
depth_mult=hparams.depth_mult,)
|
265 |
|
266 |
-
AutoConfig.register(model_loading_name,
|
267 |
-
AutoModel.register(
|
268 |
# config = EfficientNetConfig.from_pretrained(model_loading_name)
|
269 |
|
270 |
# model = EfficientNetPreTrained.from_pretrained(model_loading_name)
|
|
|
253 |
# EfficientNetConfig.model_type = "efficientnet_%s_planet_detection" % (hparams.num_channels)
|
254 |
# EfficientNetConfig.model_type = hparams.model_type
|
255 |
|
256 |
+
# config.save_pretrained(save_directory=model_loading_name)
|
257 |
|
258 |
model = EfficientNet(dropout=hparams.dropout,
|
259 |
num_channels=hparams.num_channels,
|
|
|
263 |
width_mult=hparams.width_mult,
|
264 |
depth_mult=hparams.depth_mult,)
|
265 |
|
266 |
+
AutoConfig.register(model_loading_name, EfficientNetConfig)
|
267 |
+
AutoModel.register(EfficientNetConfig, model)
|
268 |
# config = EfficientNetConfig.from_pretrained(model_loading_name)
|
269 |
|
270 |
# model = EfficientNetPreTrained.from_pretrained(model_loading_name)
|