1
0
mirror of https://github.com/malarinv/tacotron2 synced 2026-03-07 17:32:33 +00:00
This commit is contained in:
rafaelvalle
2019-04-03 13:51:59 -08:00

View File

@@ -45,10 +45,14 @@ def prepare_dataloaders(hparams):
valset = TextMelLoader(hparams.validation_files, hparams)
collate_fn = TextMelCollate(hparams.n_frames_per_step)
train_sampler = DistributedSampler(trainset) \
if hparams.distributed_run else None
if hparams.distributed_run:
train_sampler = DistributedSampler(trainset)
shuffle = False
else:
train_sampler = None
shuffle = True
train_loader = DataLoader(trainset, num_workers=1, shuffle=True,
train_loader = DataLoader(trainset, num_workers=1, shuffle=shuffle,
sampler=train_sampler,
batch_size=hparams.batch_size, pin_memory=False,
drop_last=True, collate_fn=collate_fn)