Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
90592946
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看板
提交
90592946
编写于
3月 30, 2020
作者:
M
MRXLT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ctr demo for py3
上级
c9780d95
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
200 deletion
+10
-200
compile_and_upload.sh
compile_and_upload.sh
+0
-197
python/examples/criteo_ctr/test_client.py
python/examples/criteo_ctr/test_client.py
+8
-1
python/paddle_serving_client/metric/__init__.py
python/paddle_serving_client/metric/__init__.py
+2
-2
未找到文件。
compile_and_upload.sh
已删除
100644 → 0
浏览文件 @
c9780d95
set
-e
set
-v
version
=
0.1.4
cd
./python
python change_version.py
$version
cd
..
export
PYTHONROOT
=
/usr/
export
CUDA_CUDART_LIBRARY
=
/usr/local/cuda/lib64/libcudart.so
git fetch upstream
git merge upstream/v0.2.0
git submodule init
git submodule update
function
pack
(){
mkdir
-p
bin_package
cd
bin_package
WITHAVX
=
$1
WITHMKL
=
$2
if
[
$WITHAVX
=
"ON"
-a
$WITHMKL
=
"OFF"
]
;
then
mkdir
-p
serving-cpu-avx-openblas-
$version
cp
../build_server/core/general-server/serving serving-cpu-avx-openblas-
$version
tar
-czvf
serving-cpu-avx-openblas-
$version
.tar.gz serving-cpu-avx-openblas-
$version
/
fi
if
[
$WITHAVX
=
"OFF"
-a
$WITHMKL
=
"OFF"
]
;
then
mkdir
-p
serving-cpu-noavx-openblas-
$version
cp
../build_server/core/general-server/serving serving-cpu-noavx-openblas-
$version
tar
-czvf
serving-cpu-noavx-openblas-
$version
.tar.gz serving-cpu-noavx-openblas-
$version
/
fi
if
[
$WITHAVX
=
"ON"
-a
$WITHMKL
=
"ON"
]
;
then
mkdir
-p
serving-cpu-avx-mkl-
$version
cp
../build_server/output/demo/serving/bin/serving serving-cpu-avx-mkl-
$version
cp
../build_server/third_party/install/Paddle/third_party/install/mklml/lib/
*
serving-cpu-avx-mkl-
$version
cp
../build_server/third_party/install/Paddle/third_party/install/mkldnn/lib/libdnnl.so.1 serving-gpu-
$version
tar
-czvf
serving-cpu-avx-mkl-
$version
.tar.gz serving-cpu-avx-mkl-
$version
/
fi
cd
..
}
function
pack_gpu
(){
mkdir
-p
bin_package
cd
bin_package
mkdir
-p
serving-gpu-
$version
cp
../build_gpu_server/output/demo/serving/bin/serving serving-gpu-
$version
cp
../build_gpu_server/third_party/install/Paddle/third_party/install/mklml/lib/
*
serving-gpu-
$version
cp
../build_gpu_server/third_party/install/Paddle/third_party/install/mkldnn/lib/libdnnl.so.1 serving-gpu-
$version
tar
-czvf
serving-gpu-
$version
.tar.gz serving-gpu-
$version
/
cd
..
}
function
cp_whl
(){
cp
./python/dist/paddle_serving_
*
-
$version
-py
*
../whl_package
}
function
compile_cpu
(){
mkdir
-p
build_server
cd
build_server
WITHAVX
=
$1
WITHMKL
=
$2
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python2.7
-DWITH_AVX
=
$WITHAVX
-DWITH_MKL
=
$WITHMKL
-DSERVER
=
ON ..
>
compile_log
make
-j20
>>
compile_log
make
install
>>
compile_log
cp_whl
cd
..
pack
$WITHAVX
$WITHMKL
}
function
compile_cpu_py3
(){
mkdir
-p
build_server_py3
cd
build_server_py3
WITHAVX
=
$1
WITHMKL
=
$2
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python3.6m/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython3.6m.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python3.6m
-DWITH_AVX
=
$WITHAVX
-DWITH_MKL
=
$WITHMKL
-DSERVER
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
#pack $WITHAVX $WITHMKL
}
function
compile_gpu
(){
mkdir
-p
build_gpu_server
cd
build_gpu_server
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python2.7
-DWITH_GPU
=
ON
-DSERVER
=
ON
-DCUDA_CUDART_LIBRARY
=
$CUDA_CUDART_LIBRARY
..
>
compile_log
make
-j20
>>
compile_log
make
install
>>
compile_log
cp_whl
cd
..
pack_gpu
}
function
compile_gpu_py3
(){
mkdir
-p
build_gpu_server_py3
cd
build_gpu_server_py3
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python3.6m/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython3.6m.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python3.6m
-DWITH_GPU
=
ON
-DSERVER
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
#pack_gpu
}
function
compile_client
(){
mkdir
-p
build_client
cd
build_client
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python2.7
-DCLIENT
=
ON
-DPACK
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
}
function
compile_client_py3
(){
mkdir
-p
build_client_py3
cd
build_client_py3
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python3.6m/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython3.6m.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python3.6m
-DCLIENT
=
ON
-DPACK
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
}
function
compile_app
(){
mkdir
-p
build_app
cd
build_app
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib64/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
-DAPP
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
}
function
compile_app_py3
(){
mkdir
-p
build_app_py3
cd
build_app_py3
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python3.6m/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython3.6m.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python3.6m
-DAPP
=
ON ..> compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
}
function
upload_bin
(){
cd
bin_package
python ../bos_conf/upload.py serving-cpu-avx-openblas-
$version
.tar.gz
python ../bos_conf/upload.py serving-cpu-avx-mkl-
$version
.tar.gz
python ../bos_conf/upload.py serving-cpu-noavx-openblas-
$version
.tar.gz
python ../bos_conf/upload.py serving-gpu-
$version
.tar.gz
cd
..
}
function
upload_whl
(){
cd
whl_package
#python ../bos_conf/upload_whl.py paddle_serving_client-$version-py2-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_server-$version-py2-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_server_gpu-$version-py2-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_client-$version-py3-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_server-$version-py3-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_server_gpu-$version-py3-none-any.whl
cd
..
}
#cpu-avx-openblas $1-avx $2-mkl
#compile_cpu ON OFF
#compile_cpu_py3 ON OFF
#cpu-avx-mkl
#compile_cpu ON ON
#compile_cpu_py3 ON ON
#cpu-noavx-openblas
#compile_cpu OFF OFF
#compile_cpu_py3 OFF OFF
#gpu
#compile_gpu
#compile_gpu_py3
#client
#compile_client
#compile_client_py3
#app
#compile_app
#compile_app_py3
#upload bin
#upload_bin
#upload whl
#upload_whl
python/examples/criteo_ctr/test_client.py
浏览文件 @
90592946
...
...
@@ -21,6 +21,10 @@ import time
import
criteo_reader
as
criteo
from
paddle_serving_client.metric
import
auc
import
sys
py_version
=
sys
.
version_info
[
0
]
client
=
Client
()
client
.
load_client_config
(
sys
.
argv
[
1
])
client
.
connect
([
"127.0.0.1:9292"
])
...
...
@@ -39,7 +43,10 @@ label_list = []
prob_list
=
[]
start
=
time
.
time
()
for
ei
in
range
(
1000
):
data
=
reader
().
next
()
if
py_version
==
2
:
data
=
reader
().
next
()
else
:
data
=
reader
().
__next__
()
feed_dict
=
{}
for
i
in
range
(
1
,
27
):
feed_dict
[
"sparse_{}"
.
format
(
i
-
1
)]
=
data
[
0
][
i
]
...
...
python/paddle_serving_client/metric/__init__.py
浏览文件 @
90592946
...
...
@@ -11,5 +11,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
auc
import
auc
from
acc
import
acc
from
.
auc
import
auc
from
.
acc
import
acc
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录