forked from OSSInnovation/mindspore
relax time constraint for GeneratorWorker
This commit is contained in:
parent
e2821d0769
commit
291cf767ee
|
@ -3372,7 +3372,7 @@ class _GeneratorWorkerMt(threading.Thread):
|
||||||
"""
|
"""
|
||||||
Get function for worker result queue. Block with timeout.
|
Get function for worker result queue. Block with timeout.
|
||||||
"""
|
"""
|
||||||
return self.res_queue.get(timeout=10)
|
return self.res_queue.get(timeout=30)
|
||||||
|
|
||||||
|
|
||||||
class _GeneratorWorkerMp(multiprocessing.Process):
|
class _GeneratorWorkerMp(multiprocessing.Process):
|
||||||
|
@ -3395,17 +3395,13 @@ class _GeneratorWorkerMp(multiprocessing.Process):
|
||||||
"""
|
"""
|
||||||
Get function for worker result queue. Block with timeout.
|
Get function for worker result queue. Block with timeout.
|
||||||
"""
|
"""
|
||||||
while check_iterator_cleanup() is False:
|
return self.res_queue.get(timeout=30)
|
||||||
try:
|
|
||||||
return self.res_queue.get(timeout=10)
|
|
||||||
except multiprocessing.TimeoutError:
|
|
||||||
continue
|
|
||||||
|
|
||||||
raise Exception("Generator worker process timeout")
|
|
||||||
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
self.terminate()
|
try:
|
||||||
|
self.terminate()
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class GeneratorDataset(MappableDataset):
|
class GeneratorDataset(MappableDataset):
|
||||||
|
|
Loading…
Reference in New Issue