Skip to content

Commit 1586d1a

Browse files
committed
just pluck the image size off the gaussian diffusion class
1 parent b4fb880 commit 1586d1a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

denoising_diffusion_pytorch/denoising_diffusion_pytorch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ def __init__(
597597
folder,
598598
*,
599599
ema_decay = 0.995,
600-
image_size = 128,
601600
train_batch_size = 32,
602601
train_lr = 1e-4,
603602
train_num_steps = 100000,
@@ -610,6 +609,8 @@ def __init__(
610609
augment_horizontal_flip = True
611610
):
612611
super().__init__()
612+
self.image_size = diffusion_model.image_size
613+
613614
self.model = diffusion_model
614615
self.ema = EMA(ema_decay)
615616
self.ema_model = copy.deepcopy(self.model)
@@ -623,9 +624,9 @@ def __init__(
623624
self.gradient_accumulate_every = gradient_accumulate_every
624625
self.train_num_steps = train_num_steps
625626

626-
self.ds = Dataset(folder, image_size, augment_horizontal_flip = augment_horizontal_flip)
627+
self.ds = Dataset(folder, self.image_size, augment_horizontal_flip = augment_horizontal_flip)
627628
self.dl = cycle(data.DataLoader(self.ds, batch_size = train_batch_size, shuffle = True, pin_memory = True, num_workers = cpu_count()))
628-
self.opt = Adam(diffusion_model.parameters(), lr=train_lr)
629+
self.opt = Adam(diffusion_model.parameters(), lr = train_lr)
629630

630631
self.step = 0
631632

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.20.1',
6+
version = '0.20.2',
77
license='MIT',
88
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
99
author = 'Phil Wang',

0 commit comments

Comments
 (0)