RuntimeError: DataLoader worker (pid 5657) is killed by signal: Killed. Details are lost due to multiprocessing. Rerunning with num_workers=0 may give better error trace.
I encountered into the following problem when I was trying to read a batch (32)of relatively large data sample with multi-threaded DataLoader (with num_workers=8 for example).
I have tried increasing the shared memory of ubuntu but did not work.
It will run without the num_workers argument, but it is too slow to learn from a large data set with single thread.
参考了一些答案后 改成num-worker为4 batch-size为20
In my case, I find that it caused by out of memory of machine(note that , not GPU memory). To test that when run your code, you can use command top to see the whether the memory and swap memory are used up. If so , it is the memory problem. You can use a small batch, use a small num_workers, expand your swap memory,etc. Any way could decrease your memory load would be helpful.

在使用PyTorch的DataLoader进行大规模数据集读取时,遇到内存溢出导致进程被信号杀死的问题。通过调整num_workers参数和batch-size,以及检查系统内存使用情况,可以有效解决此问题。

3694

被折叠的 条评论
为什么被折叠?



