Skip to content

Working with Lightning: which num_workers for DataLoaders? #1056

Closed Answered by arthursw
arthursw asked this question in Q&A
Discussion options

You must be logged in to vote

Ok I just found in the documentation:

num_workers refers to the number of workers used to load and transform the volumes. Multiprocessing is not needed to pop patches from the queue, so you should always use num_workers=0 for the DataLoader you instantiate to generate training batches.


[...]
patches_loader = DataLoader(
    patches_queue,
    batch_size=16,
    num_workers=0,  # this must be 0
)

So I have my answer, thanks!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fepegar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant