text_plain_output_1.png
from PIL import ImageFile

from keras.preprocessing.image import ImageDataGenerator

train_path = '../input/yoga-poses-dataset/DATASET/TRAIN'
test_path = '../input/yoga-poses-dataset/DATASET/TEST'

from keras.preprocessing.image import ImageDataGenerator
train_datagen = ImageDataGenerator(rescale=1 / 255.0, rotation_range=10, zoom_range=0.3, shear_range=0.3, fill_mode='nearest', validation_split=0.2)
test_datagen = ImageDataGenerator(rescale=1 / 255.0)

from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
batch_size = 8
train_generator = train_datagen.flow_from_directory(directory=train_path, color_mode='rgb', target_size=(224, 224), batch_size=batch_size, class_mode='sparse', subset='training', shuffle=True, seed=42)
validation_generator = train_datagen.flow_from_directory(directory=train_path, color_mode='rgb', target_size=(224, 224), batch_size=batch_size, class_mode='sparse', subset='validation', shuffle=True, seed=42)
test_generator = test_datagen.flow_from_directory(directory=test_path, target_size=(224, 224), color_mode='rgb', batch_size=batch_size, class_mode='sparse', shuffle=False, seed=42)