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

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

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

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


The following commit(s) were added to refs/heads/v1.0.0 by this push:
     new 4ef905d  fix multi worker dataloader deadlock (#9126)
4ef905d is described below

commit 4ef905d8367fd838696b30b677cc03ed28de8692
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 beb228e..48ff4ef 100644
--- a/python/mxnet/gluon/data/dataloader.py
+++ b/python/mxnet/gluon/data/dataloader.py
@@ -220,10 +220,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>'].