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

[incubator-mxnet] branch master updated: fix multi worker dataloader deadlock (#9126)

This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 500ed5f  fix multi worker dataloader deadlock (#9126)
500ed5f is described below

commit 500ed5f5def52264f2232b0c83964ed071593afe
Author: Eric Junyuan Xie <pi...@users.noreply.github.com>
AuthorDate: Mon Dec 18 21:36:03 2017 -0800

    fix multi worker dataloader deadlock (#9126)
---
 python/mxnet/gluon/data/dataloader.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/python/mxnet/gluon/data/dataloader.py b/python/mxnet/gluon/data/dataloader.py
index 8dea59f..02aa5c0 100644
--- a/python/mxnet/gluon/data/dataloader.py
+++ b/python/mxnet/gluon/data/dataloader.py
@@ -216,10 +216,11 @@ class DataLoader(object):
 
         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:

-- 
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].