From 8e3fea27d7b2e1dc34122f69a23bd296f2fbf709 Mon Sep 17 00:00:00 2001 From: liyong Date: Wed, 23 Dec 2020 10:43:05 +0800 Subject: [PATCH] fix pool not running bug --- mindspore/dataset/engine/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/dataset/engine/datasets.py b/mindspore/dataset/engine/datasets.py index 3c449cd6889..54a2b15e9f9 100644 --- a/mindspore/dataset/engine/datasets.py +++ b/mindspore/dataset/engine/datasets.py @@ -2211,7 +2211,7 @@ class _PythonCallable: self.idx = idx def __call__(self, *args): - if self.pool is not None: + if self.pool is not None and self.pool._state == 0: # pylint: disable=W0212 # This call will send the tensors along with Python callable index to the process pool. # Block, yield GIL. Current thread will reacquire GIL once result is returned. result = self.pool.apply_async(_pyfunc_worker_exec, [self.idx, *args])