Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # saves the model weights after each epoch if the validation loss decreased
- checkpoint_callback = tf.keras.callbacks.ModelCheckpoint(filepath=os.path.join(model_output_dir,'lane_navigation_check.h5'), verbose=1, save_best_only=True)
- history = model.fit_generator(image_data_generator( X_train, y_train, batch_size=100, is_training=True),
- steps_per_epoch=300,
- epochs=10,
- validation_data = image_data_generator( X_valid, y_valid, batch_size=100, is_training=False),
- validation_steps=200,
- verbose=1,
- shuffle=1,
- callbacks=[checkpoint_callback])
- # always save model output as soon as model finishes training
- model.save(os.path.join(model_output_dir,'lane_navigation_final.h5'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement