I had the same error without docker, it appears without rhyme or reason！ I changed the batch_size or num_workers, but they can’t help me?  Can anyone share your solution?
The error is as follows:
Exception socket.error: error(111, 'Connection confused') in <bound method DataLoaderIter.__del__of <torch.utils.data.dataloader.DataLoaderIter object at 0x7fb041d34690>> ignored