Closed riyaj8888 closed 4 years ago
just leave out num_workers argument and you'll be fine. Try this code:
vis_dataloader = DataLoader(siamese_dataset, shuffle=True, batch_size=8) dataiter = iter(vis_dataloader)
example_batch = next(dataiter) concatenated = torch.cat((example_batch[0],example_batch[1]),0) imshow(torchvision.utils.make_grid(concatenated)) print(example_batch[2].numpy())
I add the following line to solve the BrokenPipeError.
if __name__ == "__main__": vis_dataloader = DataLoader(siamese_dataset, shuffle=True, num_workers=8, batch_size=8) dataiter = iter(vis_dataloader) example_batch = next(dataiter) concatenated = torch.cat((example_batch[0], example_batch[1]), 0) imshow(torchvision.utils.make_grid(concatenated)) print(example_batch[2].numpy())
All solutions don't work for me. Finally I change all num_workers parameter to 0, it works well
I am updating to latest version of pytorch, and changing the dataset. The development can be viewed in the ms-celeb branch
when I run following segment of code from your Siamese network code I got this error: Anaconda Environment Python 3.6 windows 10 system:
vis_dataloader = DataLoader(siamese_dataset, shuffle=True, num_workers=8, batch_size=8) dataiter = iter(vis_dataloader)
example_batch = next(dataiter) concatenated = torch.cat((example_batch[0],example_batch[1]),0) imshow(torchvision.utils.make_grid(concatenated)) print(example_batch[2].numpy())
BrokenPipeError Traceback (most recent call last)