Fix a python exception issue on using Sequence object of keras with MirroredStrategy
This commit is contained in:
parent
dedac5053f
commit
4bc4fa3cb7
|
@ -886,15 +886,18 @@ class OrderedEnqueuer(SequenceEnqueuer):
|
||||||
`(inputs, targets)` or
|
`(inputs, targets)` or
|
||||||
`(inputs, targets, sample_weights)`.
|
`(inputs, targets, sample_weights)`.
|
||||||
"""
|
"""
|
||||||
try:
|
while self.is_running():
|
||||||
while self.is_running():
|
try:
|
||||||
inputs = self.queue.get(block=True).get()
|
inputs = self.queue.get(block=True, timeout=5).get()
|
||||||
self.queue.task_done()
|
if self.is_running():
|
||||||
|
self.queue.task_done()
|
||||||
if inputs is not None:
|
if inputs is not None:
|
||||||
yield inputs
|
yield inputs
|
||||||
except Exception: # pylint: disable=broad-except
|
except queue.Empty:
|
||||||
self.stop()
|
pass
|
||||||
six.reraise(*sys.exc_info())
|
except Exception: # pylint: disable=broad-except
|
||||||
|
self.stop()
|
||||||
|
six.reraise(*sys.exc_info())
|
||||||
|
|
||||||
|
|
||||||
def init_pool_generator(gens, random_seed=None, id_queue=None):
|
def init_pool_generator(gens, random_seed=None, id_queue=None):
|
||||||
|
|
Loading…
Reference in New Issue