Initialize test dataloader with a worker count proportional to the batch size.
This commit is contained in:
parent
ef48e819aa
commit
f994466289
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user