Dataloader resets dataset state - PyTorch Forums
discuss.pytorch.org › t › dataloader-resets-datasetOct 24, 2018 · I’ve implemented a custom dataset which generates and then caches the data for reuse. If I use the DataLoader with num_workers=0 the first epoch is slow, as the data is generated during this time, but later the caching works and the training proceeds fast. With a higher number of workers, the first epoch runs faster but at each epoch after that the dataset’s cache is empty and so overall ...