Using h5py allows for faster building of the dataset.
I also noticed that your collate function first returned numpy arrays. However, memory pinning only works if the collate function returns Tensors or map/iterable of Tensors 1. I changed that and noticed faster training (I honestly cannot remember by how much it was faster).
Finally, I added the prefetch_factor argument which was missing in the DataLoaders.
Hope this will help.
Using h5py allows for faster building of the dataset. I also noticed that your collate function first returned numpy arrays. However, memory pinning only works if the collate function returns Tensors or map/iterable of Tensors 1. I changed that and noticed faster training (I honestly cannot remember by how much it was faster). Finally, I added the
prefetch_factor
argument which was missing in theDataLoader
s. Hope this will help.