bugfix for resnet50_imagenet pretrained_ckpt

This commit is contained in:
gengdongjie 2020-05-28 09:55:52 +08:00
parent 705c71a257
commit 6930c73753
3 changed files with 12 additions and 12 deletions

View File

@ -16,7 +16,7 @@
if [ $# != 2 ] && [ $# != 3 ]
then
echo "Usage: sh run_distribute_train.sh [MINDSPORE_HCCL_CONFIG_PATH] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)"
echo "Usage: sh run_distribute_train.sh [MINDSPORE_HCCL_CONFIG_PATH] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)"
exit 1
fi
@ -32,7 +32,7 @@ PATH1=$(get_real_path $1)
PATH2=$(get_real_path $2)
if [ $# == 3 ]
then
PATH3=$(get_real_path $3)
PATH3=$(get_real_path $3)
fi
if [ ! -f "$PATH1" ]
@ -47,11 +47,11 @@ then
exit 1
fi
if [ ! -f "$PATH3" ]
then
if [ $# == 3 ] && [ ! -f "$PATH3" ]
then
echo "error: PRETRAINED_CKPT_PATH=$PATH3 is not a file"
exit 1
fi
fi
ulimit -u unlimited
export DEVICE_NUM=8

View File

@ -34,13 +34,13 @@ PATH2=$(get_real_path $2)
if [ ! -d $PATH1 ]
then
echo "error: DATASET_PATH=$1 is not a directory"
echo "error: DATASET_PATH=$PATH1 is not a directory"
exit 1
fi
if [ ! -f $PATH2 ]
then
echo "error: CHECKPOINT_PATH=$2 is not a file"
echo "error: CHECKPOINT_PATH=$PATH2 is not a file"
exit 1
fi

View File

@ -31,17 +31,17 @@ get_real_path(){
PATH1=$(get_real_path $1)
if [ $# == 2 ]
then
PATH2=$(get_real_path $2)
PATH2=$(get_real_path $2)
fi
if [ ! -d "$PATH1" ]
then
echo "error: DATASET_PATH=$PATH1 is not a directory"
exit 1
fi
fi
if [ ! -f "$PATH2" ]
then
if [ $# == 2 ] && [ ! -f "$PATH2" ]
then
echo "error: PRETRAINED_CKPT_PATH=$PATH2 is not a file"
exit 1
fi
@ -62,7 +62,7 @@ cd ./train || exit
echo "start training for device $DEVICE_ID"
env > env.log
if [ $# == 1 ]
then
then
python train.py --do_train=True --dataset_path=$PATH1 &> log &
else
python train.py --do_train=True --dataset_path=$PATH1 --pre_trained=$PATH2 &> log &