Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
WAR the dataloader issue with forked processes holding stale referenc…
Browse files Browse the repository at this point in the history
…es (#19925)
  • Loading branch information
ptrendx committed Feb 21, 2021
1 parent 2c4f5aa commit fee8bf4
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 @@ -650,6 +650,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 fee8bf4

Please sign in to comment.