Join the Kedro community

Updated 2 days ago

Saving dataset in memory for model training using ImageDataGenerator and flow_from_directory in Kedro

Is there a way to use ImageDataGenerator and flow_from_directory functions in kedro? I would like to save the dataset in memory and then use it later for model training, but I got the error message: DatasetError: Failed while saving data to data set MemoryDataset().

J
Y
S
3 comments

Hi Shu-Chun Wu,

Which Kedro and Python version are you using?

I would need the full stack trace, but I suspect this is due to deepcopying a non pickleable object with keras.
in your catalog, use:
my_dataset:
type: MemoryDataset
copy_mode: assign

For your output dataset

kedro=0.19.8 and python=3.11

Add a reply
Sign up and join the conversation on Slack