Skip to content

Instantly share code, notes, and snippets.

@quangnhat185
Created May 17, 2020 20:29
Show Gist options
  • Save quangnhat185/3d7e3ea2f582ae501163f5b0c4bed17e to your computer and use it in GitHub Desktop.
Save quangnhat185/3d7e3ea2f582ae501163f5b0c4bed17e to your computer and use it in GitHub Desktop.
BATCH_SIZE = 64
my_checkpointer = [
EarlyStopping(monitor='val_loss', patience=5, verbose=0),
ModelCheckpoint(filepath="License_character_recognition.h5", verbose=1, save_weights_only=True)
]
result = model.fit(image_gen.flow(trainX, trainY, batch_size=BATCH_SIZE),
steps_per_epoch=len(trainX) // BATCH_SIZE,
validation_data=(testX, testY),
validation_steps=len(testX) // BATCH_SIZE,
epochs=EPOCHS, callbacks=my_checkpointer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment