The issues of running Pytorch tutorial on customizing dataloader class

Hello, I was following the Pytorch tutorial of [customizing dataloader class], everything works just fine except when running the last segment of code. It just stay there without finishing, and does not print any output either.

(Developing Custom PyTorch Dataloaders — PyTorch Tutorials 1.7.1 documentation)

Could you set the num_workers to 0 and try to rerun the cell?
Depending on your setup etc. multiprocessing might run into issues (e.g. the Windows FAQ explains the if-clause guard, which is needed for Windows setups).

1 Like

Hi ptrbick, thanks for the response. It works after reducing the num_workers to zero. So another approach is to add if-then clause. I will give it a try later.