Hey @claracurrier
The above code looks correct to me. Is it possible to share a repro so that I can help debug locally?
Regarding the original error message you posted, looks like the program is trying to pass a DistributedDataParallel object through the spawn args, and hence the unpickle triggered the error. What’s in the args=(args,) when you call spawn?
  File "/opt/conda/lib/python3.6/multiprocessing/spawn.py", line 115, in _main
    self = reduction.pickle.load(from_parent)
  File "/opt/conda/lib/site-packages/torch/nn/parallel/distributed.py", line 396, in __setstate__
    self.process_group = _get_default_group()