提交 6a7b42ab 编写于 作者: B barrierye

fix bug && test=serving

上级 92e69fc7
...@@ -22,15 +22,19 @@ def single_func(idx, resource): ...@@ -22,15 +22,19 @@ def single_func(idx, resource):
client.load_client_config( client.load_client_config(
"./uci_housing_client/serving_client_conf.prototxt") "./uci_housing_client/serving_client_conf.prototxt")
client.connect(["127.0.0.1:9293", "127.0.0.1:9292"]) client.connect(["127.0.0.1:9293", "127.0.0.1:9292"])
test_reader = paddle.batch( x = [
paddle.reader.shuffle( 0.0137, -0.1136, 0.2553, -0.0692, 0.0582, -0.0727, -0.1583, -0.0584,
paddle.dataset.uci_housing.test(), buf_size=500), 0.6283, 0.4919, 0.1856, 0.0795, -0.0332
batch_size=1) ]
for data in test_reader(): for i in range(1000):
fetch_map = client.predict(feed={"x": data[0][0]}, fetch=["price"]) fetch_map = client.predict(feed={"x": x}, fetch=["price"])
if fetch_map is None:
return [[None]]
return [[0]] return [[0]]
multi_thread_runner = MultiThreadRunner() multi_thread_runner = MultiThreadRunner()
thread_num = 4 thread_num = 4
result = multi_thread_runner.run(single_func, thread_num, {}) result = multi_thread_runner.run(single_func, thread_num, {})
if None in result[0]:
exit(1)
...@@ -384,7 +384,7 @@ class Server(object): ...@@ -384,7 +384,7 @@ class Server(object):
finally: finally:
os.remove(tar_name) os.remove(tar_name)
#release lock #release lock
version_file.cloes() version_file.close()
os.chdir(self.cur_path) os.chdir(self.cur_path)
self.bin_path = self.server_path + "/serving" self.bin_path = self.server_path + "/serving"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册