Appears when loading the data set generated by pytorch DataLoader
AttributeError: Can‘t pickle local object ‘create_torchvision_dataset_w
The error is shown in the figure:
Change num_workers = 2
, to num_workers = 0
:
dataloader = torch.utils.data.DataLoader(
train_dataset, batch_size=1, shuffle=True, num_workers=2, pin_memory=gpu
)