style-based-gan-pytorch icon indicating copy to clipboard operation
style-based-gan-pytorch copied to clipboard

num_workers=1 in DataLoader

Open YoelShoshan opened this issue 4 years ago • 3 comments

Wondering - is there any reason that num_workers is hardcoded to 1, and there's no usage of more workers?

YoelShoshan avatar Nov 09 '20 11:11 YoelShoshan

It is due to this: https://github.com/rosinality/style-based-gan-pytorch/pull/48/commits/211cb45d5aeac1da1e2f29702f2f89cc94ab6c7c I remember using 1 workers is more efficient for low resolutions.

rosinality avatar Nov 09 '20 12:11 rosinality

I see - makes sense since the multi-process communication becomes heavier than the inter process communication overhead, due to the extremely small work that a single worker needs to do in small resolutions. A possible solution is to reinitialize DataLoader with bigger workers_num as the resolution increases but I assume it's not high priority.

YoelShoshan avatar Nov 09 '20 13:11 YoelShoshan

Yes. And using distributed training will be even better.

rosinality avatar Nov 09 '20 13:11 rosinality