PyTorch 0.4: DataLoader causing `RuntimeError: received 0 items of ancdata`

This occurs in PyTorch 0.4, CUDA 8.0, Python 3.6

Reason:

The problem is it's hitting the number of open file descriptors (fds). It's set to a limit of 1024 by default. I increased it to 2048 and it resolved the issue. Can you try and let me know?

Solution:
Add this part in your code:

import resource
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (2048, rlimit[1]))

Courtesy:

  • pytorch issue #973
  • fastai issue #23

你可能感兴趣的:(PyTorch 0.4: DataLoader causing `RuntimeError: received 0 items of ancdata`)