Skip to content

Commit 183f6c3

Browse files
Merge pull request #7 from MSD-IRIMAS/enh-keras-saved-models
[ENH] Replace .hdf5 saved model with .keras for new version compatibility
2 parents e2c2680 + 32ece83 commit 183f6c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

classifiers/lite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def build_model(self):
265265
monitor="loss", factor=0.5, patience=50, min_lr=1e-4
266266
)
267267
model_checkpoint = tf.keras.callbacks.ModelCheckpoint(
268-
filepath=self.output_directory + "best_model.hdf5",
268+
filepath=self.output_directory + "best_model.keras",
269269
monitor="loss",
270270
save_best_only=True,
271271
)
@@ -446,7 +446,7 @@ def _fit(xtrain, ytrain, xval, yval, plot_test):
446446
def predict(self, xtest, ytest):
447447

448448
model = tf.keras.models.load_model(
449-
self.output_directory + "best_model.hdf5", compile=False
449+
self.output_directory + "best_model.keras", compile=False
450450
)
451451

452452
start_time = time.time()

classifiers/litemv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def build_model(self):
270270
monitor="loss", factor=0.5, patience=50, min_lr=1e-4
271271
)
272272
model_checkpoint = tf.keras.callbacks.ModelCheckpoint(
273-
filepath=self.output_directory + "best_model.hdf5",
273+
filepath=self.output_directory + "best_model.keras",
274274
monitor="loss",
275275
save_best_only=True,
276276
)
@@ -451,7 +451,7 @@ def _fit(xtrain, ytrain, xval, yval, plot_test):
451451
def predict(self, xtest, ytest):
452452

453453
model = tf.keras.models.load_model(
454-
self.output_directory + "best_model.hdf5", compile=False
454+
self.output_directory + "best_model.keras", compile=False
455455
)
456456

457457
start_time = time.time()

0 commit comments

Comments
 (0)