fix issue I2NU25 cnnctc word mistakes and issue I2W9WY centerface script not support dataset input

This commit is contained in:
zhouneng 2021-01-29 13:56:13 +08:00
parent 304499dfaa
commit 14765caa49
3 changed files with 43 additions and 29 deletions

View File

@ -34,10 +34,10 @@ get_real_path(){
} }
current_exec_path=$(pwd) current_exec_path=$(pwd)
echo ${current_exec_path} echo "current_exec_path: " ${current_exec_path}
dirname_path=$(dirname "$(pwd)") dirname_path=$(dirname "$(pwd)")
echo ${dirname_path} echo "dirname_path: " ${dirname_path}
SCRIPT_NAME='train.py' SCRIPT_NAME='train.py'
@ -57,49 +57,63 @@ fi
if [ $# == 2 ] if [ $# == 2 ]
then then
use_device_id=$1
pretrained_backbone=$(get_real_path $2) 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 fi
if [ $# == 3 ] if [ $# == 3 ]
then then
use_device_id=$1
pretrained_backbone=$(get_real_path $2)
dataset_path=$(get_real_path $3) 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 fi
if [ $# == 4 ] if [ $# == 4 ]
then then
use_device_id=$1
pretrained_backbone=$(get_real_path $2)
dataset_path=$(get_real_path $3)
annot_path=$(get_real_path $4) 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 fi
if [ $# == 5 ] if [ $# == 5 ]
then 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) 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 fi
echo $use_device_id echo "use_device_id: " $use_device_id
echo $pretrained_backbone echo "pretrained_backbone: " $pretrained_backbone
echo $dataset_path echo "dataset_path: " $dataset_path
echo $annot_path echo "annot_path: " $annot_path
echo $img_dir 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 PYTHONPATH=${dirname_path}:$PYTHONPATH
export RANK_SIZE=1 export RANK_SIZE=1

View File

@ -216,7 +216,7 @@ Results and checkpoints are written to `./train_parallel_{i}` folder for device
### Training Result ### 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 ```text
# distribute training result(8p) # distribute training result(8p)

View File

@ -48,7 +48,7 @@ cp ./*.py ./eval
cp ./scripts/*.sh ./eval cp ./scripts/*.sh ./eval
cp -r ./src ./eval cp -r ./src ./eval
cd ./eval || exit cd ./eval || exit
echo "start infering for device $DEVICE_ID" echo "start inferring for device $DEVICE_ID"
env > env.log env > env.log
python eval.py --device_id=$DEVICE_ID --ckpt_path=$PATH1 &> log & python eval.py --device_id=$DEVICE_ID --ckpt_path=$PATH1 &> log &
cd .. || exit cd .. || exit