I have the same problem with pycharm debugging too. I try to debug my code without parallelization and with just fewer batch size or and data. It consumes too much memory in debug I think. I also tried vscode. It is lighter and faster for such problems.