[Pro-test is effective] ForkingPickler(file, protocol).dump(obj) BrokenPipeError: [Errno 32] Broken pipe problem solving

1. Problem description

There is a problem as shown in the figure below:

 Two, the solution

Change num_workers=1  in train.py to 0, as follows

trainset = torchvision.datasets.CIFAR10(root='./data',train=True,
                                          download=True,transform=transform)
trainloader = torch.utils.data.DataLoader(trainset,batch_size=4,
                                            shuffle = True,num_workers=1)#改为0!!!

Guess you like

Origin blog.csdn.net/weixin_52527544/article/details/127228114
Recommended