未验证 提交 4478b05a 编写于 作者: F FlyingQianMM 提交者: GitHub

worker processes won't hang when any other of workers is already done (#52975)

上级 a32c1391
......@@ -457,6 +457,7 @@ class _DataLoaderIterMultiProcess(_DataLoaderIterBase):
for i in range(self._num_workers):
indices_queue = multiprocessing.Queue()
indices_queue.cancel_join_thread()
self._indices_queues.append(indices_queue)
worker = multiprocessing.Process(
target=_worker_loop,
......
......@@ -398,3 +398,6 @@ def _worker_loop(
finally:
if use_shared_memory:
_cleanup_mmap()
if done_event.is_set():
out_queue.cancel_join_thread()
out_queue.close()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册