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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容