text_plain_output_1.png
from tensorflow.keras.preprocessing.image import ImageDataGenerator

TRAINING_DIR = '/kaggle/input/tomato/New Plant Diseases Dataset(Augmented)/train/'
VALIDATION_DIR = '/kaggle/input/tomato/New Plant Diseases Dataset(Augmented)/valid/'
train_gen = ImageDataGenerator(rescale=1.0 / 255, rotation_range=0, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, zoom_range=0.2, horizontal_flip=True, fill_mode='nearest')
valid_gen = ImageDataGenerator(rescale=1.0 / 255)
train_data = train_gen.flow_from_directory(TRAINING_DIR, target_size=(227, 227), class_mode='categorical', color_mode='rgb', batch_size=64)
valid_data = valid_gen.flow_from_directory(VALIDATION_DIR, target_size=(227, 227), class_mode='categorical', color_mode='rgb')