text_plain_output_1.png
""" Memory error here
# https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/image/ImageDataGenerator
datagen = tf.keras.preprocessing.image.ImageDataGenerator(
    rescale=1./255,
    rotation_range=30,
    brightness_range=[0.5, 1.5],
    zoom_range=[0.8, 1.2],
    horizontal_flip=True,
    vertical_flip=False)
datagen.fit(train_x)
checkpoint_path = 'cp_model_1_aptos2019-blindness-detection.ckpt'
checkpoint_dir = os.path.dirname(checkpoint_path)
# Create checkpoint callback
cp_callback = tf.keras.callbacks.ModelCheckpoint(checkpoint_path,
                                                save_weights_only=True,
                                                verbose=1)
model_1 = create_model_1()
# fits the model on batches with real-time data augmentation:
model_1.fit_generator(datagen.flow(train_x, train_y, batch_size=32),
                      steps_per_epoch=len(train_x) / 32, epochs=5,
                      callbacks=[cp_callback])
"""