qiuqiangkong / audioset_tagging_cnn

MIT License
1.32k stars 249 forks source link

Adding support for h5py & fix memory pinning #36

Open wesbz opened 3 years ago

wesbz commented 3 years ago

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.