Skip to content

Instantly share code, notes, and snippets.

@ResidentMario
Created January 28, 2019 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ResidentMario/96b6e18be971a5fa7e4b5244e146254b to your computer and use it in GitHub Desktop.
Save ResidentMario/96b6e18be971a5fa7e4b5244e146254b to your computer and use it in GitHub Desktop.
import pathlib
sample_size = len(list(pathlib.Path('../data/images_cropped/').rglob('./*')))
batch_size = 16
hist = model.fit_generator(
train_generator,
steps_per_epoch=sample_size // batch_size,
epochs=50,
validation_data=validation_generator,
validation_steps=round(sample_size * 0.2) // batch_size,
callbacks=[EarlyStopping(monitor='val_loss', min_delta=0, patience=4)]
)
model.save("clf.h5")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment