提交 74fc883e 编写于 作者: B barrierye

bug fix

上级 166e269a
......@@ -29,11 +29,11 @@ x = np.array(
lp = LineProfiler()
lp_wrapper = lp(client.predict)
for i in range(3):
for i in range(1):
fetch_map = lp_wrapper(
feed={"x": x}, fetch_with_type={"combine_op_output": "float"})
# fetch_map = client.predict(
# feed={"x": x}, fetch_with_type={"combine_op_output": "float"})
print(fetch_map)
lp.print_stats()
#lp.print_stats()
......@@ -72,7 +72,9 @@ cnn_op = UciOp(
client_config="uci_housing_client/serving_client_conf.prototxt",
server_name="127.0.0.1:9393",
fetch_names=["price"],
concurrency=1)
concurrency=1,
timeout=0.01,
retry=2)
bow_op = UciOp(
name="bow",
......@@ -86,7 +88,9 @@ bow_op = UciOp(
client_config="uci_housing_client/serving_client_conf.prototxt",
server_name="127.0.0.1:9393",
fetch_names=["price"],
concurrency=1)
concurrency=1,
timeout=-1,
retry=1)
combine_op = CombineOp(
name="combine",
......@@ -94,12 +98,14 @@ combine_op = CombineOp(
in_dtype='float',
outputs=[out_channel],
out_dtype='float',
concurrency=1)
concurrency=1,
timeout=-1,
retry=1)
logging.info(read_channel.debug())
logging.info(combine_channel.debug())
logging.info(out_channel.debug())
pyserver = PyServer(profile=False)
pyserver = PyServer(profile=False, retry=1)
pyserver.add_channel(read_channel)
pyserver.add_channel(combine_channel)
pyserver.add_channel(out_channel)
......
......@@ -42,12 +42,16 @@ class _TimeProfiler(object):
self._enable = enable
def record(self, name_with_tag):
if self._enable is False:
return
name_with_tag = name_with_tag.split("_")
tag = name_with_tag[-1]
name = '_'.join(name_with_tag[:-1])
self._time_record.put((name, tag, int(round(time.time() * 1000000))))
def print_profile(self):
if self._enable is False:
return
sys.stderr.write(self._print_head)
tmp = {}
while not self._time_record.empty():
......@@ -392,10 +396,12 @@ class Op(object):
for i in range(self._retry):
_profiler.record("{}{}-midp_0".format(self._name,
concurrency_idx))
if self._time > 0:
if self._timeout > 0:
try:
middata = func_timeout.func_timeout(
self._time, self.midprocess, args=(data, ))
self._timeout,
self.midprocess,
args=(data, ))
except func_timeout.FunctionTimedOut:
logging.error("error: timeout")
error_info = "{}({}): timeout".format(
......@@ -520,6 +526,7 @@ class GeneralPythonService(
data = python_service_channel_pb2.ChannelData()
data_id = self._get_next_id()
data.id = data_id
data.is_error = 0
for idx, name in enumerate(request.feed_var_names):
logging.debug(
self._log('name: {}'.format(request.feed_var_names[idx])))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册