Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
cef6f52f
S
Serving
项目概览
PaddlePaddle
/
Serving
1 年多 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cef6f52f
编写于
2月 05, 2020
作者:
G
guru4elephant
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add clean up scripts
上级
eec5d04e
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
5 addition
and
5 deletion
+5
-5
python/examples/imdb/clean_data.sh
python/examples/imdb/clean_data.sh
+1
-0
python/examples/imdb/local_train.py
python/examples/imdb/local_train.py
+2
-2
python/examples/imdb/test_client.py
python/examples/imdb/test_client.py
+2
-3
未找到文件。
python/examples/imdb/clean_data.sh
0 → 100644
浏览文件 @
cef6f52f
rm
-rf
imdb.vocab kvdb log
*
.pyc serving_client_conf serving_server_model test_data text_classification_data.tar.gz train_data work_dir1
python/examples/imdb/local_train.py
浏览文件 @
cef6f52f
...
@@ -53,7 +53,7 @@ if __name__ == "__main__":
...
@@ -53,7 +53,7 @@ if __name__ == "__main__":
exe
=
fluid
.
Executor
(
fluid
.
CPUPlace
())
exe
=
fluid
.
Executor
(
fluid
.
CPUPlace
())
exe
.
run
(
fluid
.
default_startup_program
())
exe
.
run
(
fluid
.
default_startup_program
())
epochs
=
30
epochs
=
6
save_dirname
=
"cnn_model"
save_dirname
=
"cnn_model"
import
paddle_serving_client.io
as
serving_io
import
paddle_serving_client.io
as
serving_io
...
@@ -62,7 +62,7 @@ if __name__ == "__main__":
...
@@ -62,7 +62,7 @@ if __name__ == "__main__":
exe
.
train_from_dataset
(
program
=
fluid
.
default_main_program
(),
exe
.
train_from_dataset
(
program
=
fluid
.
default_main_program
(),
dataset
=
dataset
,
debug
=
False
)
dataset
=
dataset
,
debug
=
False
)
logger
.
info
(
"TRAIN --> pass: {}"
.
format
(
i
))
logger
.
info
(
"TRAIN --> pass: {}"
.
format
(
i
))
if
i
==
20
:
if
i
==
5
:
serving_io
.
save_model
(
"serving_server_model"
,
serving_io
.
save_model
(
"serving_server_model"
,
"serving_client_conf"
,
"serving_client_conf"
,
{
"words"
:
data
,
"label"
:
label
},
{
"words"
:
data
,
"label"
:
label
},
...
...
python/examples/imdb/test_client.py
浏览文件 @
cef6f52f
...
@@ -10,8 +10,7 @@ for line in sys.stdin:
...
@@ -10,8 +10,7 @@ for line in sys.stdin:
words
=
[
int
(
x
)
for
x
in
group
[
1
:
int
(
group
[
0
])
+
1
]]
words
=
[
int
(
x
)
for
x
in
group
[
1
:
int
(
group
[
0
])
+
1
]]
label
=
[
int
(
group
[
-
1
])]
label
=
[
int
(
group
[
-
1
])]
feed
=
{
"words"
:
words
,
"label"
:
label
}
feed
=
{
"words"
:
words
,
"label"
:
label
}
fetch
=
[
"
cost"
,
"acc
"
,
"prediction"
]
fetch
=
[
"
acc"
,
"cost
"
,
"prediction"
]
fetch_map
=
client
.
predict
(
feed
=
feed
,
fetch
=
fetch
)
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录