AdaFace icon indicating copy to clipboard operation
AdaFace copied to clipboard

What does --numworkers do?

Open martinenkoEduard opened this issue 1 year ago • 3 comments

What does --numworkers do?

martinenkoEduard avatar Aug 01 '23 10:08 martinenkoEduard

--num_workers will set the corresponding property of the Dataloaders. You can check its exact purpose within the torch documentation. It basically sets the number of threads used by the Dataloaders.

afm215 avatar Aug 10 '23 15:08 afm215

--num_workers will set the corresponding property of the Dataloaders. You can check its exact purpose within the torch documentation. It basically sets the number of threads used by the Dataloaders.

So setting them as the ammount of cpu cores is a good choice?

martinenkoEduard avatar Aug 14 '23 06:08 martinenkoEduard

You indeed should take the number of cpus into consideration (I often limit the number of workers a bit lower than the total of available cpus in case some operations are using multithreading) , but also the amount of ram. I have no heuristics to find the right number of workers given the amount of memory, but you will have memory errors if the number of workers is too high, so I just make tests until it works.

afm215 avatar Aug 14 '23 11:08 afm215