我爱编程

PyTorch 0.4: DataLoader causing

2018-05-26  本文已影响320人  klory

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:

上一篇下一篇

猜你喜欢

热点阅读