I am working on 3D image data stored as .npy files with shape (128,128,128). When I try to use Keras ImageDataGenerator it throws the following error:
Found 0 validated image filenames belonging to 0 classes.
My code is as follows:
processed_data = r'C:/Users/dush/Desktop/Project/preprocessed'
from tensorflow.keras.preprocessing.image import ImageDataGenerator
img_size = 64
batch_size = 32
data_gen = ImageDataGenerator(horizontal_flip = True,
validation_split=0.2,
fill_mode = "nearest",
zoom_range = 0.3,
width_shift_range = 0.1,
height_shift_range = 0.1,
rotation_range = 30)
train_gen = data_gen.flow_from_dataframe(
dataframe = train,
directory = processed_data,
x_col = 'id',
y_col = 'category',
target_size=(img_size, img_size, img_size),
batch_size = batch_size,
class_mode="binary",
#validate_filenames=False,
subset='training', seed = 23) #image_generator.flow_from_dataframe
valid_gen = data_gen.flow_from_dataframe(
dataframe = train,
directory = processed_data,
x_col = 'id',
y_col = 'category',
target_size=(img_size, img_size, img_size),
#validate_filenames=False,
batch_size=batch_size,
class_mode="binary",
subset='validation', shuffle=False, seed=23)
If I set validate_filenames=False, then it identifies the filenames but get an error when fitting the model. What am I doing wrong?