Skip to content

Commit ecc6f30

Browse files
committed
for #36
1 parent f900f40 commit ecc6f30

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

denoising_diffusion_pytorch/denoising_diffusion_pytorch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from functools import partial
88

99
from torch.utils import data
10+
from multiprocessing import cpu_count
1011
from torch.cuda.amp import autocast, GradScaler
1112

1213
from pathlib import Path
@@ -598,7 +599,7 @@ def __init__(
598599
self.train_num_steps = train_num_steps
599600

600601
self.ds = Dataset(folder, image_size, augment_horizontal_flip = augment_horizontal_flip)
601-
self.dl = cycle(data.DataLoader(self.ds, batch_size = train_batch_size, shuffle=True, pin_memory=True))
602+
self.dl = cycle(data.DataLoader(self.ds, batch_size = train_batch_size, shuffle = True, pin_memory = True, num_workers = cpu_count()))
602603
self.opt = Adam(diffusion_model.parameters(), lr=train_lr)
603604

604605
self.step = 0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name = 'denoising-diffusion-pytorch',
55
packages = find_packages(),
6-
version = '0.18.2',
6+
version = '0.18.3',
77
license='MIT',
88
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
99
author = 'Phil Wang',

0 commit comments

Comments
 (0)