From 50e261237b0289b0dbaef26fdb8283aa93ae02e6 Mon Sep 17 00:00:00 2001 From: gle-bellier Date: Sun, 15 Sep 2024 19:35:50 +0200 Subject: [PATCH] Remove persistent workers. Fix #37 --- run.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index 7be343c6..aac93e25 100644 --- a/run.py +++ b/run.py @@ -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, @@ -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,