Skip to content

Commit

Permalink
Merge pull request #38 from yurujaja/37-dataloader-killed-system-memo…
Browse files Browse the repository at this point in the history
…ry-utilisation-is-monotonically-increasing-during-training

Remove persistent workers. Fix #37
  • Loading branch information
gle-bellier authored Sep 16, 2024
2 parents e6ef2e6 + 50e2612 commit 879e854
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ def main():
batch_size=cfg.batch_size, # cfg.dataset["batch"],
num_workers=cfg.num_workers,
pin_memory=True,
persistent_workers=True,
# persistent_workers=True causes memory leak
persistent_workers=False,
worker_init_fn=seed_worker,
generator=get_generator(cfg.seed),
drop_last=True,
Expand All @@ -268,7 +269,7 @@ def main():
num_workers=cfg.num_workers,
pin_memory=True,
persistent_workers=False,
# worker_init_fn=seed_worker,
worker_init_fn=seed_worker,
# generator=g,
drop_last=False,
collate_fn=collate_fn,
Expand Down

0 comments on commit 879e854

Please sign in to comment.