Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
809ba964
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
809ba964
编写于
12月 03, 2021
作者:
S
Sing_chan
提交者:
GitHub
12月 03, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add trt_mobilenet demo test in windows (#37667)
* add trt_mobilenet demo test * only deliver trt_root in run.sh
上级
07b4fe93
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
9 deletion
+28
-9
paddle/fluid/inference/api/demo_ci/run.sh
paddle/fluid/inference/api/demo_ci/run.sh
+26
-6
paddle/scripts/paddle_build.bat
paddle/scripts/paddle_build.bat
+1
-1
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+1
-2
未找到文件。
paddle/fluid/inference/api/demo_ci/run.sh
浏览文件 @
809ba964
...
...
@@ -19,9 +19,8 @@ PADDLE_ROOT=$1
TURN_ON_MKL
=
$2
# use MKL or Openblas
TEST_GPU_CPU
=
$3
# test both GPU/CPU mode or only CPU mode
DATA_DIR
=
$4
# dataset
TENSORRT_INCLUDE_DIR
=
$5
# TensorRT header file dir, default to /usr/local/TensorRT/include
TENSORRT_LIB_DIR
=
$6
# TensorRT lib file dir, default to /usr/local/TensorRT/lib
MSVC_STATIC_CRT
=
$7
TENSORRT_ROOT_DIR
=
$5
# TensorRT root dir, default to /usr
MSVC_STATIC_CRT
=
$6
inference_install_dir
=
${
PADDLE_ROOT
}
/build/paddle_inference_install_dir
WIN_DETECT
=
$(
echo
`
uname
`
|
grep
"Win"
)
# detect current platform
...
...
@@ -39,7 +38,7 @@ else
fi
USE_TENSORRT
=
OFF
if
[
-d
"
$TENSORRT_
INCLUDE_DIR
"
-a
-d
"
$TENSORRT_LIB
_DIR
"
]
;
then
if
[
-d
"
$TENSORRT_
ROOT
_DIR
"
]
;
then
USE_TENSORRT
=
ON
fi
...
...
@@ -132,6 +131,28 @@ for WITH_STATIC_LIB in ON OFF; do
fi
done
done
# --------tensorrt mobilenet on windows------
if
[
$USE_TENSORRT
==
ON
-a
$TEST_GPU_CPU
==
ON
]
;
then
rm
-rf
*
cmake ..
-G
"Visual Studio 15 2017"
-A
x64
-T
host
=
x64
-DPADDLE_LIB
=
${
inference_install_dir
}
\
-DWITH_MKL
=
$TURN_ON_MKL
\
-DDEMO_NAME
=
trt_mobilenet_demo
\
-DWITH_GPU
=
$TEST_GPU_CPU
\
-DWITH_STATIC_LIB
=
$WITH_STATIC_LIB
\
-DMSVC_STATIC_CRT
=
$MSVC_STATIC_CRT
\
-DUSE_TENSORRT
=
$USE_TENSORRT
\
-DTENSORRT_ROOT
=
$TENSORRT_ROOT_DIR
msbuild /maxcpucount /property:Configuration
=
Release cpp_inference_demo.sln
Release/trt_mobilenet_demo.exe
\
--modeldir
=
$DATA_DIR
/mobilenet/model
\
--data
=
$DATA_DIR
/mobilenet/data.txt
\
--refer
=
$DATA_DIR
/mobilenet/result.txt
if
[
$?
-ne
0
]
;
then
echo
"trt demo trt_mobilenet_demo runs fail."
exit
1
fi
fi
else
# -----simple_on_word2vec on linux/mac-----
rm
-rf
*
...
...
@@ -183,8 +204,7 @@ for WITH_STATIC_LIB in ON OFF; do
-DWITH_GPU
=
$TEST_GPU_CPU
\
-DWITH_STATIC_LIB
=
$WITH_STATIC_LIB
\
-DUSE_TENSORRT
=
$USE_TENSORRT
\
-DTENSORRT_INCLUDE_DIR
=
$TENSORRT_INCLUDE_DIR
\
-DTENSORRT_LIB_DIR
=
$TENSORRT_LIB_DIR
-DTENSORRT_ROOT
=
$TENSORRT_ROOT_DIR
make
-j
$(
nproc
)
./trt_mobilenet_demo
\
--modeldir
=
$DATA_DIR
/mobilenet/model
\
...
...
paddle/scripts/paddle_build.bat
浏览文件 @
809ba964
...
...
@@ -741,7 +741,7 @@ for /F %%i in ("%libsize%") do (
)
cd
/d
%work_dir%
\paddle\fluid\inference\api\demo_ci
%cache_dir%
\tools\busybox64.exe
bash
run
.sh
%work
_dir:\
=
/
%
%WITH_MKL%
%WITH_GPU%
%cache
_dir:\
=
/
%
/inference
_demo
%TENSORRT_ROOT%
/include
%TENSORRT_ROOT%
/lib
%MSVC_STATIC_CRT%
%cache_dir%
\tools\busybox64.exe
bash
run
.sh
%work
_dir:\
=
/
%
%WITH_MKL%
%WITH_GPU%
%cache
_dir:\
=
/
%
/inference
_demo
%TENSORRT_ROOT%
%MSVC_STATIC_CRT%
goto
:eof
:test
_inference_error
...
...
paddle/scripts/paddle_build.sh
浏览文件 @
809ba964
...
...
@@ -2236,8 +2236,7 @@ EOF
demo_ci_startTime_s
=
`
date
+%s
`
cd
${
PADDLE_ROOT
}
/paddle/fluid/inference/api/demo_ci
./run.sh
${
PADDLE_ROOT
}
${
WITH_MKL
:-
ON
}
${
WITH_GPU
:-
OFF
}
${
INFERENCE_DEMO_INSTALL_DIR
}
\
${
TENSORRT_INCLUDE_DIR
:-
/usr/local/TensorRT/include
}
\
${
TENSORRT_LIB_DIR
:-
/usr/local/TensorRT/lib
}
${
TENSORRT_ROOT_DIR
:-
/usr
}
DEMO_EXIT_CODE
=
$?
./clean.sh
demo_ci_endTime_s
=
`
date
+%s
`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录