@Regenerator
Thanks for sharing solutions. I also followed @Regenerator by moving h5py opening codes to getitem. To my experience, it seems not much slow than expected even though opening hdf5 in every iteration. But hope to get much better solution.