You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/19 05:36:06 UTC

[GitHub] piiswrong closed pull request #9126: fix multi worker dataloader deadlock

piiswrong closed pull request #9126: fix multi worker dataloader deadlock
URL: https://github.com/apache/incubator-mxnet/pull/9126
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/python/mxnet/gluon/data/dataloader.py b/python/mxnet/gluon/data/dataloader.py
index 8dea59fae9..02aa5c0414 100644
--- a/python/mxnet/gluon/data/dataloader.py
+++ b/python/mxnet/gluon/data/dataloader.py
@@ -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:


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services