Skip to content

Commit

Permalink
WAR the dataloader issue with forked processes holding stale referenc…
Browse files Browse the repository at this point in the history
…es (apache#19925)
  • Loading branch information
ptrendx authored and chinakook committed May 2, 2021
1 parent 572d132 commit 534a717
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/mxnet/gluon/data/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,10 @@ def __init__(self, dataset, batch_size=None, shuffle=False, sampler=None,
pin_device_id=self._pin_device_id,
prefetch=self._prefetch, **mx_iter_args)
else:
nd.waitall()
import gc
gc.collect()
nd.waitall()
if self._num_workers > 0:
if self._thread_pool:
self._worker_pool = ThreadPool(self._num_workers,
Expand Down

0 comments on commit 534a717

Please sign in to comment.