未验证 提交 6038458e 编写于 作者: K Kaipeng Deng 提交者: GitHub

fix yolov3 train finish error. (#2310)

上级 99e7dd5e
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
This code is based on https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py This code is based on https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py
""" """
import sys
import signal
import time import time
import numpy as np import numpy as np
import threading import threading
...@@ -12,6 +14,14 @@ except ImportError: ...@@ -12,6 +14,14 @@ except ImportError:
import Queue as queue import Queue as queue
# handle terminate reader process, do not print stack frame
def _reader_quit(signum, frame):
print("Reader process exit.")
sys.exit()
signal.signal(signal.SIGTERM, _reader_quit)
class GeneratorEnqueuer(object): class GeneratorEnqueuer(object):
""" """
Builds a queue out of a data generator. Builds a queue out of a data generator.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册