From 14765caa49e68cacd840b2c99fd6379b1d2de59b Mon Sep 17 00:00:00 2001 From: zhouneng Date: Fri, 29 Jan 2021 13:56:13 +0800 Subject: [PATCH] fix issue I2NU25 cnnctc word mistakes and issue I2W9WY centerface script not support dataset input --- .../cv/centerface/scripts/train_standalone.sh | 68 +++++++++++-------- model_zoo/official/cv/cnnctc/README.md | 2 +- .../cv/cnnctc/scripts/run_eval_ascend.sh | 2 +- 3 files changed, 43 insertions(+), 29 deletions(-) diff --git a/model_zoo/official/cv/centerface/scripts/train_standalone.sh b/model_zoo/official/cv/centerface/scripts/train_standalone.sh index 31446a8a713..0438d74319f 100644 --- a/model_zoo/official/cv/centerface/scripts/train_standalone.sh +++ b/model_zoo/official/cv/centerface/scripts/train_standalone.sh @@ -34,10 +34,10 @@ get_real_path(){ } current_exec_path=$(pwd) -echo ${current_exec_path} +echo "current_exec_path: " ${current_exec_path} dirname_path=$(dirname "$(pwd)") -echo ${dirname_path} +echo "dirname_path: " ${dirname_path} SCRIPT_NAME='train.py' @@ -57,49 +57,63 @@ fi if [ $# == 2 ] then + use_device_id=$1 pretrained_backbone=$(get_real_path $2) - if [ ! -f $pretrained_backbone ] - then - echo "error: pretrained_backbone=$pretrained_backbone is not a file" - exit 1 - fi fi if [ $# == 3 ] then + use_device_id=$1 + pretrained_backbone=$(get_real_path $2) dataset_path=$(get_real_path $3) - if [ ! -f $dataset_path ] - then - echo "error: dataset_path=$dataset_path is not a file" - exit 1 - fi fi if [ $# == 4 ] then + use_device_id=$1 + pretrained_backbone=$(get_real_path $2) + dataset_path=$(get_real_path $3) annot_path=$(get_real_path $4) - if [ ! -f $annot_path ] - then - echo "error: annot_path=$annot_path is not a file" - exit 1 - fi fi if [ $# == 5 ] then + use_device_id=$1 + pretrained_backbone=$(get_real_path $2) + dataset_path=$(get_real_path $3) + annot_path=$(get_real_path $4) img_dir=$(get_real_path $5) - if [ ! -f $img_dir ] - then - echo "error: img_dir=$img_dir is not a file" - exit 1 - fi fi -echo $use_device_id -echo $pretrained_backbone -echo $dataset_path -echo $annot_path -echo $img_dir +echo "use_device_id: " $use_device_id +echo "pretrained_backbone: " $pretrained_backbone +echo "dataset_path: " $dataset_path +echo "annot_path: " $annot_path +echo "img_dir: " $img_dir + +if [ ! -f $pretrained_backbone ] +then + echo "error: pretrained_backbone=$pretrained_backbone is not a file" +exit 1 +fi + +if [ ! -d $dataset_path ] +then + echo "error: dataset_path=$dataset_path is not a directory" +exit 1 +fi + +if [ ! -f $annot_path ] +then + echo "error: annot_path=$annot_path is not a file" +exit 1 +fi + +if [ ! -d $img_dir ] +then + echo "error: img_dir=$img_dir is not a directory" +exit 1 +fi export PYTHONPATH=${dirname_path}:$PYTHONPATH export RANK_SIZE=1 diff --git a/model_zoo/official/cv/cnnctc/README.md b/model_zoo/official/cv/cnnctc/README.md index dc5ffa4410e..535e5f3c10c 100644 --- a/model_zoo/official/cv/cnnctc/README.md +++ b/model_zoo/official/cv/cnnctc/README.md @@ -216,7 +216,7 @@ Results and checkpoints are written to `./train_parallel_{i}` folder for device ### Training Result -Training result will be stored in the example path, whose folder name begins with "train" or "train_parallel". You can find checkpoint file together with result like the followings in loss.log. +Training result will be stored in the example path, whose folder name begins with "train" or "train_parallel". You can find checkpoint file together with result like the following in loss.log. ```text # distribute training result(8p) diff --git a/model_zoo/official/cv/cnnctc/scripts/run_eval_ascend.sh b/model_zoo/official/cv/cnnctc/scripts/run_eval_ascend.sh index 1b93b0c4ff4..f6a29391dcc 100644 --- a/model_zoo/official/cv/cnnctc/scripts/run_eval_ascend.sh +++ b/model_zoo/official/cv/cnnctc/scripts/run_eval_ascend.sh @@ -48,7 +48,7 @@ cp ./*.py ./eval cp ./scripts/*.sh ./eval cp -r ./src ./eval cd ./eval || exit -echo "start infering for device $DEVICE_ID" +echo "start inferring for device $DEVICE_ID" env > env.log python eval.py --device_id=$DEVICE_ID --ckpt_path=$PATH1 &> log & cd .. || exit