Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
dac98ee7
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看板
提交
dac98ee7
编写于
12月 31, 2019
作者:
G
guru4elephant
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix general model compile problem
上级
ad7c458a
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
16 addition
and
12 deletion
+16
-12
predictor/common/constant.cpp
predictor/common/constant.cpp
+3
-0
predictor/framework/resource.cpp
predictor/framework/resource.cpp
+7
-7
predictor/framework/resource.h
predictor/framework/resource.h
+3
-4
predictor/src/pdserving.cpp
predictor/src/pdserving.cpp
+3
-1
未找到文件。
predictor/common/constant.cpp
浏览文件 @
dac98ee7
...
...
@@ -41,6 +41,9 @@ DEFINE_int32(reload_interval_s, 10, "");
DEFINE_bool
(
enable_model_toolkit
,
false
,
"enable model toolkit"
);
DEFINE_string
(
enable_protocol_list
,
"baidu_std"
,
"set protocol list"
);
DEFINE_bool
(
enable_cube
,
false
,
"enable cube"
);
DEFINE_string
(
general_model_path
,
"./conf"
,
""
);
DEFINE_string
(
general_model_file
,
"general_model.prototxt"
,
""
);
DEFINE_bool
(
enable_general_model
,
false
,
"enable general model"
);
const
char
*
START_OP_NAME
=
"startup_op"
;
}
// namespace predictor
...
...
predictor/framework/resource.cpp
浏览文件 @
dac98ee7
...
...
@@ -21,7 +21,7 @@ namespace paddle_serving {
namespace
predictor
{
using
configure
::
ResourceConf
;
using
configure
::
GeneralModelConf
;
using
configure
::
GeneralModelConf
ig
;
using
configure
::
Shape
;
using
rec
::
mcube
::
CubeAPI
;
// __thread bool p_thread_initialized = false;
...
...
@@ -104,29 +104,29 @@ int Resource::general_model_initialize(
return
0
;
}
GeneralModelConf
model_config
;
GeneralModelConf
ig
model_config
;
if
(
configure
::
read_proto_conf
(
path
,
file
,
&
model_config
)
!=
0
)
{
LOG
(
ERROR
)
<<
"Failed initialize resource from: "
<<
path
<<
"/"
<<
file
;
return
-
1
;
}
_config
.
reset
(
new
PaddleGeneralModelConfig
());
_config
->
_feed_type
.
resize
(
model_config
.
is_
feed_type_size
());
_config
->
_feed_type
.
resize
(
model_config
.
feed_type_size
());
_config
->
_is_lod_feed
.
resize
(
model_config
.
is_lod_feed_size
());
_config
->
_capacity
.
resize
(
model_config
.
feed_shape_size
());
_config
->
_feed_shape
.
resize
(
model_config
.
feed_shape_size
());
for
(
int
i
=
0
;
i
<
model_config
.
is_lod_feed_size
();
++
i
)
{
_config
->
feed_type
[
i
]
=
model_config
.
feed_type
(
i
);
_config
->
_
feed_type
[
i
]
=
model_config
.
feed_type
(
i
);
if
(
model_config
.
is_lod_feed
(
i
))
{
_config
->
_feed_shape
[
i
]
=
{
-
1
};
_config
->
_is_lod_feed
[
i
]
=
true
;
}
else
{
_config
->
capacity
[
i
]
=
1
;
_config
->
_
capacity
[
i
]
=
1
;
_config
->
_is_lod_feed
[
i
]
=
false
;
for
(
int
j
=
0
;
j
<
model_config
.
feed_shape
(
i
).
shape_size
();
++
j
)
{
int
dim
=
model_c
no
fig
.
feed_shape
(
i
).
shape
(
j
);
int
dim
=
model_c
on
fig
.
feed_shape
(
i
).
shape
(
j
);
_config
->
_feed_shape
[
i
].
push_back
(
dim
);
_config
->
capacity
[
i
]
*=
dim
;
_config
->
_
capacity
[
i
]
*=
dim
;
}
}
}
...
...
predictor/framework/resource.h
浏览文件 @
dac98ee7
...
...
@@ -27,11 +27,10 @@ namespace paddle_serving {
namespace
predictor
{
class
PaddleGeneralModelConfig
{
PaddleGeneralModelConfig
();
~
PaddleGeneralModelConfig
();
public:
PaddleGeneralModelConfig
()
{}
void
load_config
(
std
::
string
);
~
PaddleGeneralModelConfig
()
{}
public:
...
...
predictor/src/pdserving.cpp
浏览文件 @
dac98ee7
...
...
@@ -45,6 +45,8 @@ using baidu::paddle_serving::predictor::FLAGS_logger_path;
using
baidu
::
paddle_serving
::
predictor
::
FLAGS_logger_file
;
using
baidu
::
paddle_serving
::
predictor
::
FLAGS_resource_path
;
using
baidu
::
paddle_serving
::
predictor
::
FLAGS_resource_file
;
using
baidu
::
paddle_serving
::
predictor
::
FLAGS_general_model_path
;
using
baidu
::
paddle_serving
::
predictor
::
FLAGS_general_model_file
;
using
baidu
::
paddle_serving
::
predictor
::
FLAGS_reload_interval_s
;
using
baidu
::
paddle_serving
::
predictor
::
FLAGS_port
;
...
...
@@ -225,7 +227,7 @@ int main(int argc, char** argv) {
return
-
1
;
}
LOG
(
INFO
)
<<
"Succ initialize general model"
LOG
(
INFO
)
<<
"Succ initialize general model"
;
// FATAL messages are output to stderr
FLAGS_stderrthreshold
=
3
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录