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

fix multi worker dataloader deadlock #9126

Merged
merged 1 commit into from
Dec 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/mxnet/gluon/data/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,11 @@ def __iter__(self):

for idx, batch in enumerate(self._batch_sampler):
key_queue.put((idx, batch))
num_batches = idx + 1

data_buffer = {}
curr_idx = 0
for _ in range(len(self._batch_sampler)):
for _ in range(num_batches):
idx, batch = data_queue.get()
data_buffer[idx] = batch
while curr_idx in data_buffer:
Expand Down