I want to load only images without labels in using data generator. I am training an autoencoder for image reconstruction on imagenet dataset. The architecture of Imagenet dataset is similar to given below.
data/ data/train/ data/train/red/ data/train/blue/ data/train/green/ data/train/pink/
I am using the code given below.
train_it = datagen.flow_from_directory(directory=”/dataset/Imagenet2012/train/”,
target_size=(224, 224),
color_mode=”rgb”,
batch_size=32,
class_mode=None,
shuffle=True,
seed=42
)
I have changed class_mode to None but still, I am getting the error given below when I call the fit function. Code for my fit function is given below.
autoencoder.fit(val_it,val_it,
batch_size=32,
epochs=5,
verbose=2,
shuffle=True
)
And the error I am getting is
y argument is not supported when data is a generator or Sequence instance.Instead pass targets
as the second element of the generator.
I want to pass the original image as y variable in model.fit function. This dataset includes 1281167 images for training. When I try to load all the images using numpy, it is taking approx 6 hours to load. Please help me with this. Or please suggest me a code for custom data generator.
Thanks