Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
2bb36147
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看板
未验证
提交
2bb36147
编写于
1月 26, 2022
作者:
H
huangjianhui
提交者:
GitHub
1月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into develop
上级
1c4eb241
57bb49ce
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
22 addition
and
16 deletion
+22
-16
cmake/paddlepaddle.cmake
cmake/paddlepaddle.cmake
+4
-4
python/paddle_serving_app/local_predict.py
python/paddle_serving_app/local_predict.py
+15
-11
python/pipeline/channel.py
python/pipeline/channel.py
+3
-1
未找到文件。
cmake/paddlepaddle.cmake
浏览文件 @
2bb36147
...
@@ -30,7 +30,7 @@ message( "WITH_GPU = ${WITH_GPU}")
...
@@ -30,7 +30,7 @@ message( "WITH_GPU = ${WITH_GPU}")
# Paddle Version should be one of:
# Paddle Version should be one of:
# latest: latest develop build
# latest: latest develop build
# version number like 1.5.2
# version number like 1.5.2
SET
(
PADDLE_VERSION
"2.2.
0
"
)
SET
(
PADDLE_VERSION
"2.2.
2
"
)
if
(
WITH_GPU
)
if
(
WITH_GPU
)
message
(
"CUDA:
${
CUDA_VERSION
}
, CUDNN_MAJOR_VERSION:
${
CUDNN_MAJOR_VERSION
}
"
)
message
(
"CUDA:
${
CUDA_VERSION
}
, CUDNN_MAJOR_VERSION:
${
CUDNN_MAJOR_VERSION
}
"
)
# cuda 11.0 is not supported, 11.2 would be added.
# cuda 11.0 is not supported, 11.2 would be added.
...
@@ -58,9 +58,9 @@ elseif (WITH_LITE)
...
@@ -58,9 +58,9 @@ elseif (WITH_LITE)
message
(
"cpu arch:
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
message
(
"cpu arch:
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
if
(
WITH_XPU
)
if
(
WITH_XPU
)
if
(
CMAKE_SYSTEM_PROCESSOR STREQUAL
"x86_64"
)
if
(
CMAKE_SYSTEM_PROCESSOR STREQUAL
"x86_64"
)
SET
(
PADDLE_LIB_VERSION
"
x86-64_gcc8.2
_avx_mkl"
)
SET
(
PADDLE_LIB_VERSION
"
${
PADDLE_VERSION
}
/cxx_c/Linux/XPU/x86-64_gcc8.2_py36
_avx_mkl"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR STREQUAL
"aarch64"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR STREQUAL
"aarch64"
)
SET
(
PADDLE_LIB_VERSION
"
arm64_gcc7.3
_openblas"
)
SET
(
PADDLE_LIB_VERSION
"
${
PADDLE_VERSION
}
/cxx_c/Linux/XPU/arm64_gcc7.3_py36
_openblas"
)
endif
()
endif
()
elseif
(
WITH_ASCEND_CL
)
elseif
(
WITH_ASCEND_CL
)
if
(
CMAKE_SYSTEM_PROCESSOR STREQUAL
"x86_64"
)
if
(
CMAKE_SYSTEM_PROCESSOR STREQUAL
"x86_64"
)
...
@@ -97,7 +97,7 @@ endif()
...
@@ -97,7 +97,7 @@ endif()
if
(
WITH_LITE
)
if
(
WITH_LITE
)
if
(
WITH_XPU
)
if
(
WITH_XPU
)
SET
(
PADDLE_LIB_PATH
"https://paddle-inference-lib.bj.bcebos.com/
2.2.0-rc0/cxx_c/Linux/XPU/
${
PADDLE_LIB_VERSION
}
/paddle_inference_install_dir.tar.gz "
)
SET
(
PADDLE_LIB_PATH
"https://paddle-inference-lib.bj.bcebos.com/
${
PADDLE_LIB_VERSION
}
/paddle_inference_install_dir.tar.gz "
)
elseif
(
WITH_ASCEND_CL
)
elseif
(
WITH_ASCEND_CL
)
SET
(
PADDLE_LIB_PATH
"http://paddle-serving.bj.bcebos.com/inferlib/
${
PADDLE_LIB_VERSION
}
/paddle_inference_install_dir.tgz "
)
SET
(
PADDLE_LIB_PATH
"http://paddle-serving.bj.bcebos.com/inferlib/
${
PADDLE_LIB_VERSION
}
/paddle_inference_install_dir.tgz "
)
endif
()
endif
()
...
...
python/paddle_serving_app/local_predict.py
浏览文件 @
2bb36147
...
@@ -160,10 +160,10 @@ class LocalPredictor(object):
...
@@ -160,10 +160,10 @@ class LocalPredictor(object):
"use_trt:{}, use_lite:{}, use_xpu:{}, precision:{}, use_calib:{}, "
"use_trt:{}, use_lite:{}, use_xpu:{}, precision:{}, use_calib:{}, "
"use_mkldnn:{}, mkldnn_cache_capacity:{}, mkldnn_op_list:{}, "
"use_mkldnn:{}, mkldnn_cache_capacity:{}, mkldnn_op_list:{}, "
"mkldnn_bf16_op_list:{}, use_feed_fetch_ops:{}, "
"mkldnn_bf16_op_list:{}, use_feed_fetch_ops:{}, "
"use_ascend_cl:{}, min_subgraph_size:{}, dynamic_shape_info:{}"
.
format
(
"use_ascend_cl:{}, min_subgraph_size:{}, dynamic_shape_info:{}"
.
model_path
,
use_gpu
,
gpu_id
,
use_profile
,
thread_num
,
mem_opti
m
,
format
(
model_path
,
use_gpu
,
gpu_id
,
use_profile
,
thread_nu
m
,
ir_optim
,
use_trt
,
use_lite
,
use_xpu
,
precision
,
use_calib
,
mem_optim
,
ir_optim
,
use_trt
,
use_lite
,
use_xpu
,
precision
,
use_mkldnn
,
mkldnn_cache_capacity
,
mkldnn_op_list
,
use_calib
,
use_mkldnn
,
mkldnn_cache_capacity
,
mkldnn_op_list
,
mkldnn_bf16_op_list
,
use_feed_fetch_ops
,
use_ascend_cl
,
mkldnn_bf16_op_list
,
use_feed_fetch_ops
,
use_ascend_cl
,
min_subgraph_size
,
dynamic_shape_info
))
min_subgraph_size
,
dynamic_shape_info
))
...
@@ -338,7 +338,8 @@ class LocalPredictor(object):
...
@@ -338,7 +338,8 @@ class LocalPredictor(object):
# Assemble the input data of paddle predictor, and filter invalid inputs.
# Assemble the input data of paddle predictor, and filter invalid inputs.
input_names
=
self
.
predictor
.
get_input_names
()
input_names
=
self
.
predictor
.
get_input_names
()
for
name
in
input_names
:
for
name
in
input_names
:
if
isinstance
(
feed
[
name
],
list
):
if
isinstance
(
feed
[
name
],
list
)
and
not
isinstance
(
feed
[
name
][
0
],
str
):
feed
[
name
]
=
np
.
array
(
feed
[
name
]).
reshape
(
self
.
feed_shapes_
[
feed
[
name
]
=
np
.
array
(
feed
[
name
]).
reshape
(
self
.
feed_shapes_
[
name
])
name
])
if
self
.
feed_types_
[
name
]
==
0
:
if
self
.
feed_types_
[
name
]
==
0
:
...
@@ -365,6 +366,9 @@ class LocalPredictor(object):
...
@@ -365,6 +366,9 @@ class LocalPredictor(object):
feed
[
name
]
=
feed
[
name
].
astype
(
"complex64"
)
feed
[
name
]
=
feed
[
name
].
astype
(
"complex64"
)
elif
self
.
feed_types_
[
name
]
==
11
:
elif
self
.
feed_types_
[
name
]
==
11
:
feed
[
name
]
=
feed
[
name
].
astype
(
"complex128"
)
feed
[
name
]
=
feed
[
name
].
astype
(
"complex128"
)
elif
isinstance
(
feed
[
name
],
list
)
and
isinstance
(
feed
[
name
][
0
],
str
):
pass
else
:
else
:
raise
ValueError
(
"local predictor receives wrong data type"
)
raise
ValueError
(
"local predictor receives wrong data type"
)
...
...
python/pipeline/channel.py
浏览文件 @
2bb36147
...
@@ -34,6 +34,7 @@ from .error_catch import CustomExceptionCode as ChannelDataErrcode
...
@@ -34,6 +34,7 @@ from .error_catch import CustomExceptionCode as ChannelDataErrcode
_LOGGER
=
logging
.
getLogger
(
__name__
)
_LOGGER
=
logging
.
getLogger
(
__name__
)
class
ChannelDataType
(
enum
.
Enum
):
class
ChannelDataType
(
enum
.
Enum
):
"""
"""
Channel data type
Channel data type
...
@@ -167,7 +168,8 @@ class ChannelData(object):
...
@@ -167,7 +168,8 @@ class ChannelData(object):
elif
isinstance
(
npdata
,
dict
):
elif
isinstance
(
npdata
,
dict
):
# batch_size = 1
# batch_size = 1
for
_
,
value
in
npdata
.
items
():
for
_
,
value
in
npdata
.
items
():
if
not
isinstance
(
value
,
np
.
ndarray
):
if
not
isinstance
(
value
,
np
.
ndarray
)
and
not
(
isinstance
(
value
,
list
)
and
isinstance
(
value
[
0
],
str
)):
error_code
=
ChannelDataErrcode
.
TYPE_ERROR
.
value
error_code
=
ChannelDataErrcode
.
TYPE_ERROR
.
value
error_info
=
"Failed to check data: the value "
\
error_info
=
"Failed to check data: the value "
\
"of data must be np.ndarray, but get {}."
.
format
(
"of data must be np.ndarray, but get {}."
.
format
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录