CUDA out of memory error

DataLoader with 2 worokers will spawn 2 subprocesses, so you’re using it. There’s a problem with Python’s multiprocessing where it doesn’t always clean up the child processes properly. If you don’t have any other python jobs running and it’s your private computer you might try killall python, if not you have to look for the worker processes and kill them…