Initialize test dataloader with a worker count proportional to the batch size.

This commit is contained in:
James Betker 2020-05-10 10:49:37 -06:00
parent ef48e819aa
commit f994466289

View File

@ -22,7 +22,7 @@ def create_dataloader(dataset, dataset_opt, opt=None, sampler=None):
pin_memory=False)
else:
batch_size = dataset_opt['batch_size'] or 1
return torch.utils.data.DataLoader(dataset, batch_size=batch_size, shuffle=False, num_workers=0,
return torch.utils.data.DataLoader(dataset, batch_size=batch_size, shuffle=False, num_workers=int(batch_size/2),
pin_memory=False)