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)
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)
fi
if [ $# == 3 ]
then
use_device_id=$1
pretrained_backbone=$(get_real_path $2)
dataset_path=$(get_real_path $3)
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)
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)
fi
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
fi
if [ $# == 3 ]
if [ ! -d $dataset_path ]
then
dataset_path=$(get_real_path $3)
if [ ! -f $dataset_path ]
then
echo "error: dataset_path=$dataset_path is not a file"
echo "error: dataset_path=$dataset_path is not a directory"
exit 1
fi
fi
if [ $# == 4 ]
then
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 ]
if [ ! -d $img_dir ]
then
img_dir=$(get_real_path $5)
if [ ! -f $img_dir ]
then
echo "error: img_dir=$img_dir is not a file"
echo "error: img_dir=$img_dir is not a directory"
exit 1
fi
fi
echo $use_device_id
echo $pretrained_backbone
echo $dataset_path
echo $annot_path
echo $img_dir
export PYTHONPATH=${dirname_path}:$PYTHONPATH
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 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)

View File

@ -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