Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
book
提交
bec4aeda
B
book
项目概览
PaddlePaddle
/
book
通知
16
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
40
列表
看板
标记
里程碑
合并请求
37
Wiki
5
Wiki
分析
仓库
DevOps
项目成员
Pages
B
book
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
40
Issue
40
列表
看板
标记
里程碑
合并请求
37
合并请求
37
Pages
分析
分析
仓库分析
DevOps
Wiki
5
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bec4aeda
编写于
9月 13, 2017
作者:
H
helinwang
提交者:
GitHub
9月 13, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #391 from helinwang/fix
Add serve API notes
上级
7c11e51a
95de3b44
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
1 deletion
+13
-1
02.recognize_digits/train.py
02.recognize_digits/train.py
+1
-0
03.image_classification/train.py
03.image_classification/train.py
+1
-0
05.recommender_system/train.py
05.recommender_system/train.py
+1
-0
06.understand_sentiment/train.py
06.understand_sentiment/train.py
+1
-0
08.machine_translation/train.py
08.machine_translation/train.py
+1
-0
serve/README.md
serve/README.md
+8
-1
未找到文件。
02.recognize_digits/train.py
浏览文件 @
bec4aeda
...
...
@@ -5,6 +5,7 @@ import paddle.v2 as paddle
with_gpu
=
os
.
getenv
(
'WITH_GPU'
,
'0'
)
!=
'0'
def
softmax_regression
(
img
):
predict
=
paddle
.
layer
.
fc
(
input
=
img
,
size
=
10
,
act
=
paddle
.
activation
.
Softmax
())
...
...
03.image_classification/train.py
浏览文件 @
bec4aeda
...
...
@@ -21,6 +21,7 @@ from resnet import resnet_cifar10
with_gpu
=
os
.
getenv
(
'WITH_GPU'
,
'0'
)
!=
'0'
def
main
():
datadim
=
3
*
32
*
32
classdim
=
10
...
...
05.recommender_system/train.py
浏览文件 @
bec4aeda
...
...
@@ -5,6 +5,7 @@ import os
with_gpu
=
os
.
getenv
(
'WITH_GPU'
,
'0'
)
!=
'0'
def
get_usr_combined_features
():
uid
=
paddle
.
layer
.
data
(
name
=
'user_id'
,
...
...
06.understand_sentiment/train.py
浏览文件 @
bec4aeda
...
...
@@ -17,6 +17,7 @@ import paddle.v2 as paddle
with_gpu
=
os
.
getenv
(
'WITH_GPU'
,
'0'
)
!=
'0'
def
convolution_net
(
input_dim
,
class_dim
=
2
,
emb_dim
=
128
,
hid_dim
=
128
):
data
=
paddle
.
layer
.
data
(
"word"
,
paddle
.
data_type
.
integer_value_sequence
(
input_dim
))
...
...
08.machine_translation/train.py
浏览文件 @
bec4aeda
...
...
@@ -4,6 +4,7 @@ import paddle.v2 as paddle
with_gpu
=
os
.
getenv
(
'WITH_GPU'
,
'0'
)
!=
'0'
def
save_model
(
parameters
,
save_path
):
with
open
(
save_path
,
'w'
)
as
f
:
parameters
.
to_tar
(
f
)
...
...
serve/README.md
浏览文件 @
bec4aeda
...
...
@@ -6,7 +6,14 @@ PaddlePaddle. It provides an HTTP endpoint.
## Run
The inference server reads a trained model (a topology file and a
parameter file) and serves HTTP requests at port
`8000`
.
parameter file) and serves HTTP request at port
`8000`
. Because models
differ in the numbers and types of inputs,
**
the HTTP API will differ
slightly for each model,
**
please see
[
HTTP API
](
#http-api
)
for the
API spec,
and
[
here
](
https://github.com/PaddlePaddle/book/wiki/PaddlePaddle-Book-pretrained-model
)
for
the request examples of different models that illustrate the
difference.
We will first show how to obtain the PaddlePaddle model, and then how
to start the server.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录