Skip to content

Commit a0e8ea4

Browse files
authored
Merge pull request #230 from mehdidc/data_sampler_set_epoch
use data_sampler.set_epoch to avoid having the same order in each epoch
2 parents 90bf9df + 724e11e commit a0e8ea4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

train_dalle.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ def save_model(path):
312312
# training
313313

314314
for epoch in range(EPOCHS):
315+
if data_sampler:
316+
data_sampler.set_epoch(epoch)
315317
for i, (text, images) in enumerate(distr_dl):
316318
if args.fp16:
317319
images = images.half()

0 commit comments

Comments
 (0)