PicklingError: Can’t pickle <function at 0x000002AD125A6318>: attribute lookup on main failed
环境:win10, python3.7, jupyter notebook
报错来源:20天吃掉那只pytorch-DAY2
报错原因:cell3 + cell4 ⬅ torch.utils.data
一、cell3 + cell4
# cell3
def target_transform(t):
return torch.tensor([t]).float()
ds_train = datasets.ImageFolder("./dataset/cifar2/train/",
transform = transform_train,target_transform= lambda t:torch.tensor([t]).float())
ds_valid = datasets.