From 9f1ec3a5377dcf799c08f631d3bbe6733037e634 Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Wed, 22 Jun 2022 16:09:50 +0800 Subject: [PATCH] fix GPUID settting and correct LOG_PATH --- test_tipc/test_inference_cpp.sh | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/test_tipc/test_inference_cpp.sh b/test_tipc/test_inference_cpp.sh index abba66503..ea3ba3f1b 100644 --- a/test_tipc/test_inference_cpp.sh +++ b/test_tipc/test_inference_cpp.sh @@ -2,10 +2,17 @@ source test_tipc/common_func.sh FILENAME=$1 -GPUID=$2 +MODE=$2 + +# set cuda device +GPUID=$3 if [[ ! $GPUID ]];then GPUID=0 fi +env="export CUDA_VISIBLE_DEVICES=${GPUID}" +set CUDA_VISIBLE_DEVICES +eval $env + dataline=$(awk 'NR==1, NR==19{print}' $FILENAME) # parser params @@ -30,7 +37,7 @@ cpp_benchmark_value=$(func_parser_value "${lines[16]}") generate_yaml_cmd=$(func_parser_value "${lines[17]}") transform_index_cmd=$(func_parser_value "${lines[18]}") -LOG_PATH="./test_tipc/output/${model_name}" +LOG_PATH="./test_tipc/output/${model_name}/${MODE}" mkdir -p ${LOG_PATH} status_log="${LOG_PATH}/results_cpp.log" # generate_yaml_cmd="python3 test_tipc/generate_cpp_yaml.py" @@ -235,18 +242,6 @@ cd ../../../ # cd ../../ echo "################### build PaddleClas demo finished ###################" - -# set cuda device -# GPUID=$2 -# if [ ${#GPUID} -le 0 ];then -# env="export CUDA_VISIBLE_DEVICES=0" -# else -# env="export CUDA_VISIBLE_DEVICES=${GPUID}" -# fi -# set CUDA_VISIBLE_DEVICES -# eval $env - - echo "################### run test ###################" export Count=0 IFS="|"