Skip to content

Commit

Permalink
add num_threads to train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
junyanz committed Jun 4, 2020
1 parent 1f7575e commit 66a1cb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train.py
Expand Up @@ -26,7 +26,7 @@
transforms.RandomResizedCrop(opt.fineSize, interpolation=3)]),
transforms.RandomHorizontalFlip(),
transforms.ToTensor()]))
dataset_loader = torch.utils.data.DataLoader(dataset, batch_size=opt.batch_size, shuffle=True)
dataset_loader = torch.utils.data.DataLoader(dataset, batch_size=opt.batch_size, shuffle=True, num_workers=int(opt.num_threads))

dataset_size = len(dataset)
print('#training images = %d' % dataset_size)
Expand Down

0 comments on commit 66a1cb2

Please sign in to comment.