def save_labels(train_generator):
    for (image_batch, label_batch) in train_generator:
        break
    print(image_batch.shape, label_batch.shape)
    print(train_generator.class_indices)
    labels = '\n'.join(sorted(train_generator.class_indices.keys()))
    with open('labels.txt', 'w') as f:
        f.write(labels)
def save_labels(train_generator):
    for (image_batch, label_batch) in train_generator:
        break
    print(image_batch.shape, label_batch.shape)
    print(train_generator.class_indices)
    labels = '\n'.join(sorted(train_generator.class_indices.keys()))
    with open('labels.txt', 'w') as f:
        f.write(labels)