提交 cef6f52f 编写于 作者: G guru4elephant

add clean up scripts

上级 eec5d04e
rm -rf imdb.vocab kvdb log *.pyc serving_client_conf serving_server_model test_data text_classification_data.tar.gz train_data work_dir1
......@@ -53,7 +53,7 @@ if __name__ == "__main__":
exe = fluid.Executor(fluid.CPUPlace())
exe.run(fluid.default_startup_program())
epochs = 30
epochs = 6
save_dirname = "cnn_model"
import paddle_serving_client.io as serving_io
......@@ -62,7 +62,7 @@ if __name__ == "__main__":
exe.train_from_dataset(program=fluid.default_main_program(),
dataset=dataset, debug=False)
logger.info("TRAIN --> pass: {}".format(i))
if i == 20:
if i == 5:
serving_io.save_model("serving_server_model",
"serving_client_conf",
{"words": data, "label": label},
......
......@@ -10,8 +10,7 @@ for line in sys.stdin:
words = [int(x) for x in group[1:int(group[0]) + 1]]
label = [int(group[-1])]
feed = {"words": words, "label": label}
fetch = ["cost", "acc", "prediction"]
fetch = ["acc", "cost", "prediction"]
fetch_map = client.predict(feed=feed, fetch=fetch)
print(fetch_map)
#print("{} {}".format(fetch_map["prediction"][1], label[0]))
print("{} {}".format(fetch_map["prediction"][1], label[0]))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册