Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
5557a2f6
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看板
提交
5557a2f6
编写于
5月 21, 2019
作者:
W
Wang Guibao
提交者:
GitHub
5月 21, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix image classification bug (#6)
* Fix image classification bug
上级
7da09539
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
28 addition
and
40 deletion
+28
-40
demo-serving/op/classify_op.h
demo-serving/op/classify_op.h
+4
-0
demo-serving/op/reader_op.cpp
demo-serving/op/reader_op.cpp
+5
-6
demo-serving/op/reader_op.h
demo-serving/op/reader_op.h
+4
-0
demo-serving/op/text_classification_op.h
demo-serving/op/text_classification_op.h
+4
-0
inferencer-fluid-cpu/include/fluid_cpu_engine.h
inferencer-fluid-cpu/include/fluid_cpu_engine.h
+4
-0
inferencer-fluid-gpu/include/fluid_gpu_engine.h
inferencer-fluid-gpu/include/fluid_gpu_engine.h
+5
-3
predictor/src/pdserving.cpp
predictor/src/pdserving.cpp
+2
-0
release.bcloud
release.bcloud
+0
-31
未找到文件。
demo-serving/op/classify_op.h
浏览文件 @
5557a2f6
...
...
@@ -15,7 +15,11 @@
#pragma once
#include <vector>
#ifdef BCLOUD
#ifdef WITH_GPU
#include "paddle/paddle_inference_api.h"
#else
#include "paddle/fluid/inference/api/paddle_inference_api.h"
#endif
#else
#include "paddle/fluid/inference/paddle_inference_api.h"
#endif
...
...
demo-serving/op/reader_op.cpp
浏览文件 @
5557a2f6
...
...
@@ -63,9 +63,11 @@ int ReaderOp::inference() {
// tls resource assignment
size_t
dense_capacity
=
3
*
resize
.
width
*
resize
.
height
;
size_t
len
=
dense_capacity
*
sizeof
(
float
)
*
sample_size
;
float
*
data
=
reinterpret_cast
<
float
*>
(
MempoolWrapper
::
instance
().
malloc
(
len
));
if
(
data
==
NULL
)
{
// Allocate buffer in PaddleTensor, so that buffer will be managed by the Tensor
in_tensor
.
data
.
Resize
(
len
);
float
*
data
=
reinterpret_cast
<
float
*>
(
in_tensor
.
data
.
data
());
if
(
in_tensor
.
data
.
data
()
==
NULL
)
{
LOG
(
ERROR
)
<<
"Failed create temp float array, "
<<
"size="
<<
dense_capacity
*
sample_size
*
sizeof
(
float
);
return
-
1
;
...
...
@@ -144,9 +146,6 @@ int ReaderOp::inference() {
}
}
}
paddle
::
PaddleBuf
pbuf
(
data
,
len
);
in_tensor
.
data
=
pbuf
;
in
->
push_back
(
in_tensor
);
return
0
;
...
...
demo-serving/op/reader_op.h
浏览文件 @
5557a2f6
...
...
@@ -29,7 +29,11 @@
#include "opencv/highgui.h"
#ifdef BCLOUD
#ifdef WITH_GPU
#include "paddle/paddle_inference_api.h"
#else
#include "paddle/fluid/inference/api/paddle_inference_api.h"
#endif
#else
#include "paddle/fluid/inference/paddle_inference_api.h"
#endif
...
...
demo-serving/op/text_classification_op.h
浏览文件 @
5557a2f6
...
...
@@ -15,7 +15,11 @@
#pragma once
#include <vector>
#ifdef BCLOUD
#ifdef WITH_GPU
#include "paddle/paddle_inference_api.h"
#else
#include "paddle/fluid/inference/api/paddle_inference_api.h"
#endif
#else
#include "paddle/fluid/inference/paddle_inference_api.h"
#endif
...
...
inferencer-fluid-cpu/include/fluid_cpu_engine.h
浏览文件 @
5557a2f6
...
...
@@ -22,7 +22,11 @@
#include "configure/include/configure_parser.h"
#include "configure/inferencer_configure.pb.h"
#ifdef BCLOUD
#ifdef WITH_GPU
#include "paddle/paddle_inference_api.h"
#else
#include "paddle/fluid/inference/api/paddle_inference_api.h"
#endif
#else
#include "paddle/fluid/inference/paddle_inference_api.h"
#endif
...
...
inferencer-fluid-gpu/include/fluid_gpu_engine.h
浏览文件 @
5557a2f6
...
...
@@ -133,8 +133,9 @@ class FluidGpuAnalysisCore : public FluidFamilyCore {
analysis_config
.
SetProgFile
(
data_path
+
"/__model__"
);
analysis_config
.
EnableUseGpu
(
100
,
FLAGS_gpuid
);
analysis_config
.
SetCpuMathLibraryNumThreads
(
1
);
analysis_config
.
EnableMemoryOptim
(
false
,
false
);
analysis_config
.
SwitchSpecifyInputNames
(
true
);
analysis_config
.
EnableMemoryOptim
();
AutoLock
lock
(
GlobalPaddleCreateMutex
::
instance
());
_core
=
paddle
::
CreatePaddlePredictor
<
paddle
::
AnalysisConfig
>
(
analysis_config
);
...
...
@@ -191,7 +192,8 @@ class FluidGpuAnalysisDirCore : public FluidFamilyCore {
analysis_config
.
EnableUseGpu
(
100
,
FLAGS_gpuid
);
analysis_config
.
SwitchSpecifyInputNames
(
true
);
analysis_config
.
SetCpuMathLibraryNumThreads
(
1
);
analysis_config
.
EnableMemoryOptim
();
analysis_config
.
EnableMemoryOptim
(
false
,
false
);
AutoLock
lock
(
GlobalPaddleCreateMutex
::
instance
());
_core
=
paddle
::
CreatePaddlePredictor
<
paddle
::
AnalysisConfig
>
(
analysis_config
);
...
...
@@ -498,7 +500,7 @@ class FluidGpuAnalysisDirWithSigmoidCore : public FluidGpuWithSigmoidCore {
analysis_config
.
EnableUseGpu
(
100
,
FLAGS_gpuid
);
analysis_config
.
SwitchSpecifyInputNames
(
true
);
analysis_config
.
SetCpuMathLibraryNumThreads
(
1
);
analysis_config
.
EnableMemoryOptim
();
analysis_config
.
EnableMemoryOptim
(
false
,
false
);
AutoLock
lock
(
GlobalPaddleCreateMutex
::
instance
());
_core
->
_fluid_core
=
paddle
::
CreatePaddlePredictor
<
paddle
::
AnalysisConfig
>
(
analysis_config
);
...
...
predictor/src/pdserving.cpp
浏览文件 @
5557a2f6
...
...
@@ -51,6 +51,8 @@ using baidu::paddle_serving::predictor::FLAGS_port;
using
baidu
::
paddle_serving
::
configure
::
InferServiceConf
;
using
baidu
::
paddle_serving
::
configure
::
read_proto_conf
;
DECLARE_bool
(
logtostderr
);
void
print_revision
(
std
::
ostream
&
os
,
void
*
)
{
#if defined(PDSERVING_VERSION)
os
<<
PDSERVING_VERSION
;
...
...
release.bcloud
已删除
100644 → 0
浏览文件 @
7da09539
mkdir -p demo/serving/bin
mv bin/serving demo/serving/bin
mkdir -p demo/client/bin
mv bin/dense_format demo/client/bin/
mv bin/echo demo/client/bin
mv bin/int64tensor_format demo/client/bin
mv bin/sparse_format demo/client/bin
mv bin/text_classification demo/client/bin
mv bin/text_classification_press demo/client/bin
mv bin/ximage demo/client/bin
cp baidu_third-party_mklml/so/* demo/serving/bin/
rm -rf baidu_third-party_mklml
# Download test model and test dataset
pushd .
cd demo/client/data
mkdir -p text_classification
cd text_classification
wget --no-check-certificate https://paddle-serving.bj.bcebos.com/data/text_classification/test_set.tar.gz
tar zxvf test_set.tar.gz
popd
pushd .
cd demo/serving/
mkdir -p data/model/paddle/fluid/
cd data/model/paddle/fluid/
wget --no-check-certificate https://paddle-serving.bj.bcebos.com/data/text_classification/text_classification_lstm.tar.gz
tar zxvf text_classification_lstm.tar.gz
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录