not sure how you did the settings for the Dataloader. In my case, I have the same error when not setting the collate_fn=utils.collate_fn. See the tutorial example link 16 and how it declares

# define training and validation data loaders
data_loader = torch.utils.data.DataLoader(
    dataset, batch_size=2, shuffle=True, num_workers=4,
    collate_fn=utils.collate_fn)