This code is in the get_item of the dataloader.
My desktop computer should be fine, but it has trouble especially with a lower number of workers. If I increase the number, the problem is diminished but still there. The same code works fine in a dedicated server environment.