Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
edc64789
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看板
提交
edc64789
编写于
5月 16, 2020
作者:
D
Dong Daxiang
提交者:
GitHub
5月 16, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #564 from guru4elephant/fix_numpy_predict
Fix numpy predict
上级
40ec2e5e
471c1eae
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
6 addition
and
5 deletion
+6
-5
core/general-client/src/general_model.cpp
core/general-client/src/general_model.cpp
+5
-5
python/paddle_serving_app/local_predict.py
python/paddle_serving_app/local_predict.py
+1
-0
未找到文件。
core/general-client/src/general_model.cpp
浏览文件 @
edc64789
...
@@ -345,7 +345,7 @@ int PredictorClient::numpy_predict(
...
@@ -345,7 +345,7 @@ int PredictorClient::numpy_predict(
PredictorRes
&
predict_res_batch
,
PredictorRes
&
predict_res_batch
,
const
int
&
pid
)
{
const
int
&
pid
)
{
int
batch_size
=
std
::
max
(
float_feed_batch
.
size
(),
int_feed_batch
.
size
());
int
batch_size
=
std
::
max
(
float_feed_batch
.
size
(),
int_feed_batch
.
size
());
VLOG
(
2
)
<<
"batch size: "
<<
batch_size
;
predict_res_batch
.
clear
();
predict_res_batch
.
clear
();
Timer
timeline
;
Timer
timeline
;
int64_t
preprocess_start
=
timeline
.
TimeStampUS
();
int64_t
preprocess_start
=
timeline
.
TimeStampUS
();
...
@@ -462,7 +462,7 @@ int PredictorClient::numpy_predict(
...
@@ -462,7 +462,7 @@ int PredictorClient::numpy_predict(
for
(
ssize_t
j
=
0
;
j
<
int_array
.
shape
(
1
);
j
++
)
{
for
(
ssize_t
j
=
0
;
j
<
int_array
.
shape
(
1
);
j
++
)
{
for
(
ssize_t
k
=
0
;
k
<
int_array
.
shape
(
2
);
k
++
)
{
for
(
ssize_t
k
=
0
;
k
<
int_array
.
shape
(
2
);
k
++
)
{
for
(
ssize_t
l
=
0
;
k
<
int_array
.
shape
(
3
);
l
++
)
{
for
(
ssize_t
l
=
0
;
k
<
int_array
.
shape
(
3
);
l
++
)
{
tensor
->
add_
float
_data
(
int_array
(
i
,
j
,
k
,
l
));
tensor
->
add_
int64
_data
(
int_array
(
i
,
j
,
k
,
l
));
}
}
}
}
}
}
...
@@ -474,7 +474,7 @@ int PredictorClient::numpy_predict(
...
@@ -474,7 +474,7 @@ int PredictorClient::numpy_predict(
for
(
ssize_t
i
=
0
;
i
<
int_array
.
shape
(
0
);
i
++
)
{
for
(
ssize_t
i
=
0
;
i
<
int_array
.
shape
(
0
);
i
++
)
{
for
(
ssize_t
j
=
0
;
j
<
int_array
.
shape
(
1
);
j
++
)
{
for
(
ssize_t
j
=
0
;
j
<
int_array
.
shape
(
1
);
j
++
)
{
for
(
ssize_t
k
=
0
;
k
<
int_array
.
shape
(
2
);
k
++
)
{
for
(
ssize_t
k
=
0
;
k
<
int_array
.
shape
(
2
);
k
++
)
{
tensor
->
add_
float
_data
(
int_array
(
i
,
j
,
k
));
tensor
->
add_
int64
_data
(
int_array
(
i
,
j
,
k
));
}
}
}
}
}
}
...
@@ -484,7 +484,7 @@ int PredictorClient::numpy_predict(
...
@@ -484,7 +484,7 @@ int PredictorClient::numpy_predict(
auto
int_array
=
int_feed
[
vec_idx
].
unchecked
<
2
>
();
auto
int_array
=
int_feed
[
vec_idx
].
unchecked
<
2
>
();
for
(
ssize_t
i
=
0
;
i
<
int_array
.
shape
(
0
);
i
++
)
{
for
(
ssize_t
i
=
0
;
i
<
int_array
.
shape
(
0
);
i
++
)
{
for
(
ssize_t
j
=
0
;
j
<
int_array
.
shape
(
1
);
j
++
)
{
for
(
ssize_t
j
=
0
;
j
<
int_array
.
shape
(
1
);
j
++
)
{
tensor
->
add_
float
_data
(
int_array
(
i
,
j
));
tensor
->
add_
int64
_data
(
int_array
(
i
,
j
));
}
}
}
}
break
;
break
;
...
@@ -492,7 +492,7 @@ int PredictorClient::numpy_predict(
...
@@ -492,7 +492,7 @@ int PredictorClient::numpy_predict(
case
1
:
{
case
1
:
{
auto
int_array
=
int_feed
[
vec_idx
].
unchecked
<
1
>
();
auto
int_array
=
int_feed
[
vec_idx
].
unchecked
<
1
>
();
for
(
ssize_t
i
=
0
;
i
<
int_array
.
shape
(
0
);
i
++
)
{
for
(
ssize_t
i
=
0
;
i
<
int_array
.
shape
(
0
);
i
++
)
{
tensor
->
add_
float
_data
(
int_array
(
i
));
tensor
->
add_
int64
_data
(
int_array
(
i
));
}
}
break
;
break
;
}
}
...
...
python/paddle_serving_app/local_predict.py
浏览文件 @
edc64789
...
@@ -71,6 +71,7 @@ class Debugger(object):
...
@@ -71,6 +71,7 @@ class Debugger(object):
if
profile
:
if
profile
:
config
.
enable_profile
()
config
.
enable_profile
()
config
.
set_cpu_math_library_num_threads
(
cpu_num
)
config
.
set_cpu_math_library_num_threads
(
cpu_num
)
config
.
switch_ir_optim
(
False
)
self
.
predictor
=
create_paddle_predictor
(
config
)
self
.
predictor
=
create_paddle_predictor
(
config
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录