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

yolov3 reader add except log (#3364)

上级 d48e3934
...@@ -19,6 +19,7 @@ from __future__ import unicode_literals ...@@ -19,6 +19,7 @@ from __future__ import unicode_literals
import numpy as np import numpy as np
import os import os
import sys
import random import random
import time import time
import copy import copy
...@@ -302,10 +303,11 @@ def train(size=416, ...@@ -302,10 +303,11 @@ def train(size=416,
if not use_multiprocess_reader: if not use_multiprocess_reader:
return generator return generator
else: else:
print("multiprocess is not fully compatible with Windows, " if sys.platform == "win32":
"you can set --use_multiprocess_reader=False if you " print("multiprocess is not fully compatible with Windows, "
"are training on Windows and there are errors incured " "you can set --use_multiprocess_reader=False if you "
"by multiprocess.") "are training on Windows and there are errors incured "
"by multiprocess.")
print("multiprocess reader starting up, it takes a while...") print("multiprocess reader starting up, it takes a while...")
def infinite_reader(): def infinite_reader():
...@@ -333,8 +335,10 @@ def train(size=416, ...@@ -333,8 +335,10 @@ def train(size=416,
enqueuer.stop() enqueuer.stop()
return return
generator_out = None generator_out = None
except Exception as e:
print("Exception occured in reader: {}".format(str(e)))
finally: finally:
if enqueuer is not None: if enqueuer:
enqueuer.stop() enqueuer.stop()
return reader return reader
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册