IMS-Toucan
IMS-Toucan copied to clipboard
Where to change the number of dataloader workers ?
Hi,
My computer is not recent apart from the RTX 3090 GPU and it has only 4 cores. So I keep getting this warning :
UserWarning: This DataLoader will create 12 worker processes in total. Our suggested max number of worker in current system is 4, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
I am looking to change this value and see if it speeds up the training (or if it has no effect) but I could not find the parameter to change except somewhere (I think it was for the aligner but I can't find it anymore).
Any help appreciated,
Good point, I should make the number of workers dynamic based on os.cpu_count. Next release will have this, unti then you have to change it manually. For the aligner it is located here:
https://github.com/DigitalPhonetics/IMS-Toucan/blob/afbf183fc8da40a9672d339f03083905e0319f64/TrainingInterfaces/Text_to_Spectrogram/AutoAligner/autoaligner_train_loop.py#L51
It's always in the train_loop.py of the corresponding model.
Given that your warning says 12, it is probably the one in the PortaSpeech train loop:
https://github.com/DigitalPhonetics/IMS-Toucan/blob/afbf183fc8da40a9672d339f03083905e0319f64/TrainingInterfaces/Text_to_Spectrogram/PortaSpeech/portaspeech_train_loop.py#L81