Creating Custom Dataset with LightningDataModule

Hello,

first I want to thank you for this amazing framework. I am a phd student in engineering and try to train a neural network with pytorch lightning. I collected my own data for a dataset (images and corresponding values as float). Now I try to create a LightningDataModule, but I struggle with data preparation. Can you tell me, what has to be inside the function prepare_data and what it returns?

prepare_data function is not designed to return anything. It is used to handle functionality like downloading the data and saving to your disk, etc. It is for stuff before you do any functions on the data.

If you already have all the data downloaded and are in place for further steps, then you can even skip defining this function.

Use this method to do things that might write to disk or that need to be done only from a single GPU in distributed settings.

taken from the documentation

1 Like

I see.
Thank you very much for the fast reply.