多进程导致的内存不够用了吧
将数据集读取的进程修改为
trainset = torchvision.datasets.CIFAR100(root=args.data_path, train=True, download=False, transform=transform_train) trainloader = torch.utils.data.DataLoader(trainset, batch_size=args.batch_size, shuffle=True, num_workers=0) testset = torchvision.datasets.CIFAR100(root=args.data_path, train=False, download=False, transform=transform_test) testloader = torch.utils.data.DataLoader(testset, batch_size=args.batch_size, shuffle=False, num_workers=0)
num_workers = 0 既可