Thank you for your answer. I have found the problem. In getitem  method in my custom dataset images transformations are performed using function from skiimage that takes too much time to perform. I have substituted them with opencv functions that performs more or less the same operations very very faster. In this way loading the batches are more fast and It solves my problem