When I am trying to set up train and validation datasets reading from the same dataframe with 80-20 split for train-validation data, getting this error
img_data_generator = ImageDataGenerator(rescale=1/255,
validation_split=0.2,
rotation_range = 180,
horizontal_flip = True,
vertical_flip = True,
)
## Recreate datasets from dataframe
train_df = img_data_generator.flow_from_dataframe(dataframe=train_df,
directory="./frames/",
x_col="img_name",
y_col= "label_names",
target_size=(224, 224),
class_mode='categorical',
batch_size=32,
subset='training',
shuffle=True,
)
val_df = img_data_generator.flow_from_dataframe(dataframe=train_df,
directory="./frames/",
x_col="img_name",
y_col="label_names",
target_size=(224, 224),
class_mode='categorical',
batch_size=32,
subset='validation',
shuffle=True,
)
After this getting this error:
AttributeError: 'DataFrameIterator' object has no attribute 'copy'