When using multi workers to load data, you’d better to reserve file-descriptor in workers(i.e in getitem() method), not in main process(i.e. in init() method).
You can refer this post(and it’s reply): DataLoader, when num_worker >0, there is bug - #14 by piojanu 4