mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-19 05:54:20 +00:00
Speed up yesno training to finish in ~10s on CPU
Setting `persistent_workers=True` when creating DataLoader removes a significant overhead at the start of each epoch and validation.
This commit is contained in:
parent
dfccadc6b6
commit
6f2128a511
@ -209,7 +209,7 @@ class YesNoAsrDataModule(DataModule):
|
|||||||
sampler=train_sampler,
|
sampler=train_sampler,
|
||||||
batch_size=None,
|
batch_size=None,
|
||||||
num_workers=self.args.num_workers,
|
num_workers=self.args.num_workers,
|
||||||
persistent_workers=False,
|
persistent_workers=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
return train_dl
|
return train_dl
|
||||||
@ -236,6 +236,7 @@ class YesNoAsrDataModule(DataModule):
|
|||||||
batch_size=None,
|
batch_size=None,
|
||||||
sampler=sampler,
|
sampler=sampler,
|
||||||
num_workers=self.args.num_workers,
|
num_workers=self.args.num_workers,
|
||||||
|
persistent_workers=True,
|
||||||
)
|
)
|
||||||
return test_dl
|
return test_dl
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user