Fix PyTorch RuntimeError: DataLoader worker (pid xxx) is killed by signal: Killed – PyTorch Tutorial

By | September 6, 2022

When we are using pytorch to train a deep learning model, we may get this error: RuntimeError: DataLoader worker (pid xxx) is killed by signal: Killed. In this tutorial, we will introduce you how to fix it.

This error looks like below:

Fix PyTorch RuntimeError: DataLoader worker (pid xxx) is killed by signal: Killed - PyTorch Tutorial

How to fix this RuntimeError?

The reason for his error occurs is there is no enough memory space to store data. In order to fix this error, we can try these methods:

  • 1.decrease batch size
  • 2.do not save more data in memory, you can load them when need
  • 3.increase the memory space

There is another tutorial for fixing memory error:

Fix Tensorflow Allocation Memory: Allocation exceeds 10% of system memory Error

Leave a Reply