提交 e3dfec3c 编写于 作者: W wangjiawei04

fix code style

上级 282c7c8d
......@@ -36,6 +36,7 @@ fetch_map = client.predict(
"im_info": np.array(list(im.shape[1:]) + [1.0]),
"im_shape": np.array(list(im.shape[1:]) + [1.0])
},
fetch=["multiclass_nms"], batch=False)
fetch=["multiclass_nms"],
batch=False)
fetch_map["image"] = sys.argv[3]
postprocess(fetch_map)
......@@ -48,13 +48,17 @@ def single_func(idx, resource):
for i in range(1000):
if args.batch_size >= 1:
feed_batch = []
feed = {"words": [], "words.lod":[0]}
feed = {"words": [], "words.lod": [0]}
for bi in range(args.batch_size):
word_ids, label = imdb_dataset.get_words_and_label(dataset[bi])
feed["words.lod"].append(feed["words.lod"][-1] + len(word_ids))
word_ids, label = imdb_dataset.get_words_and_label(dataset[
bi])
feed["words.lod"].append(feed["words.lod"][-1] + len(
word_ids))
feed["words"].extend(word_ids)
feed["words"] = np.array(feed["words"]).reshape(len(feed["words"]), 1)
result = client.predict(feed=feed, fetch=["prediction"], batch=True)
feed["words"] = np.array(feed["words"]).reshape(
len(feed["words"]), 1)
result = client.predict(
feed=feed, fetch=["prediction"], batch=True)
if result is None:
raise ("predict failed.")
else:
......
......@@ -35,6 +35,7 @@ fetch_map = client.predict(
"image": im,
"im_size": np.array(list(im.shape[1:])),
},
fetch=["save_infer_model/scale_0.tmp_0"], batch=False)
fetch=["save_infer_model/scale_0.tmp_0"],
batch=False)
fetch_map["image"] = sys.argv[1]
postprocess(fetch_map)
......@@ -843,8 +843,8 @@ class Op(object):
else:
self.concurrency_idx = concurrency_idx
# init client
self.client = self.init_client(
self._client_config, self._server_endpoints)
self.client = self.init_client(self._client_config,
self._server_endpoints)
# user defined
self.init_op()
......
......@@ -23,7 +23,7 @@ info_content = open(info_py, 'r').readlines()
version_line = [
l.strip() for l in info_content if l.startswith('__version__')
][0]
exec (version_line) # produce __version__
exec(version_line) # produce __version__
setuptools.setup(
name="paddle-gpu-serving",
......
......@@ -1108,7 +1108,7 @@ function main() {
build_app $TYPE # pwd: /Serving
java_run_test $TYPE # pwd: /Serving
python_run_test $TYPE # pwd: /Serving
monitor_test $TYPE # pwd: /Serving
#monitor_test $TYPE # pwd: /Serving
echo "serving $TYPE part finished as expected."
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册