Create hdf5 file for custom dataset

I have very larger files in dataset.
Currenty I am using a laptop gpu for my work.
Now I want to use Google colab. uploading such a large number of file is not feasible.
I am thinking to load images from hdf5 files stored in my google drive.

So currently I have custom dataset class which return two input and one label.

Can anyone suggest me how I can transform my dataset into hdf5 file.

Do you really need to store it as an hdf5 file?
If no, my suggestion would be:

  • Upload the dataset(files) to Drive.

  • Mount Drive in Colab.

  • Use the dataset from Drive.