The problem was different - one of the data loader uses cuda internally (because the data goes through a cleaning network before being returned). This was the problem. Is there a way to a void ‘spawn’ method in this case?
You can’t use CUDA with fork. But you can set the ctx for just one data loader by specifying multiprocessing_context='spawn' when creating the data loader.