ValueError: too many values to unpack (expected 3), - PyTorch ...
discuss.pytorch.org › t › valueerror-too-many-valuesJan 27, 2022 · I think your use case is hitting this case, so you might need to use something like this:. def my_collate(batch): return [torch.stack(e, dim=0) for e in list(zip(*batch))] dataset = torch.utils.data.TensorDataset(torch.zeros(100, 1), torch.ones(100, 1), torch.ones(100, 1)*2) loader = torch.utils.data.DataLoader(dataset, batch_size=3, collate_fn=my_collate) for a, b, c in loader: print(a, a ...
Too many values to unpack (expected 2) - PyTorch …
23.10.2020 · ValueError: too many values to unpack (expected 2) here is my code: train_ds = Dataset(data=train_files, transform=train_transforms) dataloader_train = torch.utils.data.DataLoader( train_ds, batch_size=2, …