-
Notifications
You must be signed in to change notification settings - Fork 6k
support infer_ut on windows nightly build #35049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
OliverLPH
merged 3 commits into
PaddlePaddle:develop
from
OliverLPH:enable_windows_infer_ut
Aug 23, 2021
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ TENSORRT_ROOT_DIR=$5 # TensorRT ROOT dir, default to /usr/local/TensorRT | |
| MSVC_STATIC_CRT=$6 | ||
| inference_install_dir=${PADDLE_ROOT}/build/paddle_inference_install_dir | ||
| EXIT_CODE=0 # init default exit code | ||
| WIN_DETECT=$(echo `uname` | grep "Win") # detect current platform | ||
|
|
||
| export RED='\033[0;31m' # red color | ||
| export NC='\033[0m' # no color | ||
|
|
@@ -48,7 +49,7 @@ if [ -d "$TENSORRT_ROOT_DIR" ]; then | |
| USE_TENSORRT=ON | ||
| fi | ||
|
|
||
| # download vis_demo data | ||
|
|
||
| function download() { | ||
| url_prefix=$1 | ||
| model_name=$2 | ||
|
|
@@ -57,8 +58,13 @@ function download() { | |
| if [[ -e "${model_name}.tgz" ]]; then | ||
| echo "${model_name}.tgz has been downloaded." | ||
| else | ||
| wget -q --no-proxy ${url_prefix}/${model_name}.tgz | ||
| tar xzf *.tgz | ||
| if [ $WIN_DETECT != "" ]; then | ||
| wget -q ${url_prefix}/${model_name}.tgz | ||
| tar xzf *.tgz | ||
| else | ||
| wget -q --no-proxy ${url_prefix}/${model_name}.tgz | ||
| tar xzf *.tgz | ||
| fi | ||
| fi | ||
| cd .. | ||
| } | ||
|
|
@@ -105,15 +111,30 @@ function compile_test() { | |
| mkdir -p ${build_dir} | ||
| cd ${build_dir} | ||
| TEST_NAME=$1 | ||
| cmake .. -DPADDLE_LIB=${inference_install_dir} \ | ||
| if [ $WIN_DETECT != "" ]; then | ||
| cmake .. -G "Visual Studio 15 2017" -A x64 -T host=x64 -DPADDLE_LIB=${inference_install_dir} \ | ||
| -DWITH_MKL=$TURN_ON_MKL \ | ||
| -DDEMO_NAME=${TEST_NAME} \ | ||
| -DWITH_GPU=$TEST_GPU_CPU \ | ||
| -DWITH_STATIC_LIB=OFF \ | ||
| -DUSE_TENSORRT=$USE_TENSORRT \ | ||
| -DTENSORRT_ROOT=$TENSORRT_ROOT_DIR \ | ||
| -DWITH_GTEST=ON | ||
| make -j$(nproc) | ||
| -DMSVC_STATIC_CRT=$MSVC_STATIC_CRT \ | ||
| -DWITH_GTEST=ON \ | ||
| -DCMAKE_CXX_FLAGS='/std:c++17' \ | ||
| -DCMAKE_BUILD_TYPE=Release | ||
| msbuild /maxcpucount /property:Configuration=Release ALL_BUILD.vcxproj; | ||
|
||
| else | ||
| cmake .. -DPADDLE_LIB=${inference_install_dir} \ | ||
| -DWITH_MKL=$TURN_ON_MKL \ | ||
| -DDEMO_NAME=${TEST_NAME} \ | ||
| -DWITH_GPU=$TEST_GPU_CPU \ | ||
| -DWITH_STATIC_LIB=OFF \ | ||
| -DUSE_TENSORRT=$USE_TENSORRT \ | ||
| -DTENSORRT_ROOT=$TENSORRT_ROOT_DIR \ | ||
| -DWITH_GTEST=ON | ||
| make -j$(nproc) | ||
| fi; | ||
| cd - | ||
| } | ||
|
|
||
|
|
@@ -129,96 +150,99 @@ rm -rf * | |
| if [ $USE_TENSORRT == ON -a $TEST_GPU_CPU == ON ]; then | ||
| rm -rf * | ||
|
|
||
| if [ $WIN_DETECT != "" ]; then | ||
| exe_dir=${build_dir}/Release | ||
| else | ||
| exe_dir=${build_dir} | ||
| fi; | ||
|
|
||
| printf "${YELLOW} start test_resnet50 ${NC} \n"; | ||
| compile_test "test_resnet50" | ||
| ./test_resnet50 \ | ||
| ${exe_dir}/test_resnet50 \ | ||
| --modeldir=$DATA_DIR/resnet50/resnet50 \ | ||
| --gtest_output=xml:test_resnet50.xml | ||
| --gtest_output=xml:${log_dir}/test_resnet50.xml | ||
| if [ $? -ne 0 ]; then | ||
| echo "test_resnet50 runs failed" >> ${current_dir}/build/test_summary.txt | ||
| echo "test_resnet50 runs failed" >> ${exe_dir}/test_summary.txt | ||
| EXIT_CODE=1 | ||
| fi | ||
|
|
||
| printf "${YELLOW} start test_det_mv3_db ${NC} \n"; | ||
| compile_test "test_det_mv3_db" | ||
| make -j$(nproc) | ||
| ./test_det_mv3_db \ | ||
| ${exe_dir}/test_det_mv3_db \ | ||
| --modeldir=$DATA_DIR/ocr_det_mv3_db/ocr_det_mv3_db \ | ||
| --gtest_output=xml:test_det_mv3_db.xml | ||
| --gtest_output=xml:${log_dir}/test_det_mv3_db.xml | ||
| if [ $? -ne 0 ]; then | ||
| echo "test_det_mv3_db runs failed" >> ${current_dir}/build/test_summary.txt | ||
| echo "test_det_mv3_db runs failed" >> ${exe_dir}/test_summary.txt | ||
| EXIT_CODE=1 | ||
| fi | ||
|
|
||
| printf "${YELLOW} start test_LeViT ${NC} \n"; | ||
| compile_test "test_LeViT" | ||
| ./test_LeViT \ | ||
| ${exe_dir}/test_LeViT \ | ||
| --modeldir=$DATA_DIR/LeViT/LeViT \ | ||
| --gtest_output=xml:test_LeViT.xml | ||
| --gtest_output=xml:${log_dir}/test_LeViT.xml | ||
| if [ $? -ne 0 ]; then | ||
| echo "test_LeViT runs failed" >> ${current_dir}/build/test_summary.txt | ||
| echo "test_LeViT runs failed" >> ${exe_dir}/test_summary.txt | ||
| EXIT_CODE=1 | ||
| fi | ||
|
|
||
| printf "${YELLOW} start test_ernie_text_cls ${NC} \n"; | ||
| compile_test "test_ernie_text_cls" | ||
| ./test_ernie_text_cls \ | ||
| ${exe_dir}/test_ernie_text_cls \ | ||
| --modeldir=$DATA_DIR/ernie_text_cls/ernie_text_cls \ | ||
| --gtest_output=xml:test_ernie_text_cls.xml | ||
| --gtest_output=xml:${log_dir}/test_ernie_text_cls.xml | ||
| if [ $? -ne 0 ]; then | ||
| echo "test_ernie_text_cls runs failed" >> ${current_dir}/build/test_summary.txt | ||
| echo "test_ernie_text_cls runs failed" >> ${exe_dir}/test_summary.txt | ||
| EXIT_CODE=1 | ||
| fi | ||
|
|
||
| printf "${YELLOW} start test_yolov3 ${NC} \n"; | ||
| compile_test "test_yolov3" | ||
| ./test_yolov3 \ | ||
| ${exe_dir}/test_yolov3 \ | ||
| --modeldir=$DATA_DIR/yolov3/yolov3 \ | ||
| --gtest_output=xml:test_yolov3.xml | ||
| --gtest_output=xml:${log_dir}/test_yolov3.xml | ||
| if [ $? -ne 0 ]; then | ||
| echo "test_yolov3 runs failed" >> ${current_dir}/build/test_summary.txt | ||
| echo "test_yolov3 runs failed" >> ${exe_dir}/test_summary.txt | ||
| EXIT_CODE=1 | ||
| fi | ||
|
|
||
| printf "${YELLOW} start test_ppyolo_mbv3 ${NC} \n"; | ||
| compile_test "test_ppyolo_mbv3" | ||
| ./test_ppyolo_mbv3 \ | ||
| ${exe_dir}/test_ppyolo_mbv3 \ | ||
| --modeldir=$DATA_DIR/ppyolo_mbv3/ppyolo_mbv3 \ | ||
| --gtest_output=xml:test_ppyolo_mbv3.xml | ||
| --gtest_output=xml:${log_dir}/test_ppyolo_mbv3.xml | ||
| if [ $? -ne 0 ]; then | ||
| echo "test_ppyolo_mbv3 runs failed" >> ${current_dir}/build/test_summary.txt | ||
| echo "test_ppyolo_mbv3 runs failed" >> ${exe_dir}/test_summary.txt | ||
| EXIT_CODE=1 | ||
| fi | ||
|
|
||
| printf "${YELLOW} start test_ppyolov2_r50vd ${NC} \n"; | ||
| compile_test "test_ppyolov2_r50vd" | ||
| ./test_ppyolov2_r50vd \ | ||
| ${exe_dir}/test_ppyolov2_r50vd \ | ||
| --modeldir=$DATA_DIR/ppyolov2_r50vd/ppyolov2_r50vd \ | ||
| --gtest_output=xml:test_ppyolov2_r50vd.xml | ||
| --gtest_output=xml:${log_dir}/test_ppyolov2_r50vd.xml | ||
| if [ $? -ne 0 ]; then | ||
| echo "test_ppyolov2_r50vd runs failed" >> ${current_dir}/build/test_summary.txt | ||
| echo "test_ppyolov2_r50vd runs failed" >> ${exe_dir}/test_summary.txt | ||
| EXIT_CODE=1 | ||
| fi | ||
|
|
||
| printf "${YELLOW} start test_resnet50_quant ${NC} \n"; | ||
| compile_test "test_resnet50_quant" | ||
| ./test_resnet50_quant \ | ||
| ${exe_dir}/test_resnet50_quant \ | ||
| --int8dir=$DATA_DIR/resnet50_quant/resnet50_quant/resnet50_quant \ | ||
| --modeldir=$DATA_DIR/resnet50/resnet50 \ | ||
| --datadir=$DATA_DIR/resnet50_quant/resnet50_quant/imagenet-eval-binary/9.data \ | ||
| --gtest_output=xml:test_resnet50_quant.xml | ||
| --gtest_output=xml:${log_dir}/test_resnet50_quant.xml | ||
| if [ $? -ne 0 ]; then | ||
| echo "test_resnet50_quant runs failed" >> ${current_dir}/build/test_summary.txt | ||
| echo "test_resnet50_quant runs failed" >> ${exe_dir}/test_summary.txt | ||
| EXIT_CODE=1 | ||
| fi | ||
|
|
||
| cp ./*.xml ${log_dir}; | ||
| fi | ||
|
|
||
|
|
||
| if [[ -f ${current_dir}/build/test_summary.txt ]];then | ||
| if [[ -f ${exe_dir}/test_summary.txt ]];then | ||
| echo "=====================test summary======================" | ||
| cat ${current_dir}/build/test_summary.txt | ||
| cat ${exe_dir}/test_summary.txt | ||
| echo "========================================================" | ||
| fi | ||
| echo "infer_ut script finished" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux用代理能下载过吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linux用代理可以下载
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段逻辑是windows用代理,Linux不用代理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前修改为
Linux下:wget -q --no-proxy 取消代理
Windows下:使用busybox,wget -q -Y off 取消代理