美文网首页我爱编程
PyTorch 0.4: DataLoader causing

PyTorch 0.4: DataLoader causing

作者: klory | 来源:发表于2018-05-26 09:34 被阅读320次

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

    本文链接:https://www.haomeiwen.com/subject/xmnpjftx.html