Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tensorflow.keras.preprocessing.image import ImageDataGenerator
- import numpy as np
- from PIL import Image
- import matplotlib.pyplot as plt
- datagen = ImageDataGenerator(rescale=1./255, validation_split=0.25)
- train_datagen_flow = datagen.flow_from_directory(
- '/datasets/fruits_small/',
- target_size=(150, 150),
- batch_size=16,
- class_mode='sparse',
- subset='training',
- seed=12345)
- val_datagen_flow = datagen.flow_from_directory(
- '/datasets/fruits_small/',
- target_size=(150, 150),
- batch_size=16,
- class_mode='sparse',
- subset='validation',
- seed=12345)
- print(train_datagen_flow[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement