From 585b05e66b730d6da52cbe27538ad6c4386908d3 Mon Sep 17 00:00:00 2001 From: James Betker Date: Wed, 13 May 2020 09:20:45 -0600 Subject: [PATCH] Cap test workers at 10 --- codes/data/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/data/__init__.py b/codes/data/__init__.py index cc1d9e86..97157006 100644 --- a/codes/data/__init__.py +++ b/codes/data/__init__.py @@ -14,7 +14,7 @@ def create_dataloader(dataset, dataset_opt, opt=None, sampler=None): batch_size = dataset_opt['batch_size'] // world_size shuffle = False else: - num_workers = dataset_opt['n_workers'] * len(opt['gpu_ids']) + num_workers = max(dataset_opt['n_workers'] * len(opt['gpu_ids']), 10) batch_size = dataset_opt['batch_size'] shuffle = True return torch.utils.data.DataLoader(dataset, batch_size=batch_size, shuffle=shuffle,