diff --git a/example/resnet50_imagenet2012/run_distribute_train.sh b/example/resnet50_imagenet2012/run_distribute_train.sh index 235a48e9c8fbf36ddcc0b303f2c93cf0611b8ebb..22157608e60e945498f123f96c477bac3ec3a593 100755 --- a/example/resnet50_imagenet2012/run_distribute_train.sh +++ b/example/resnet50_imagenet2012/run_distribute_train.sh @@ -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 diff --git a/example/resnet50_imagenet2012/run_infer.sh b/example/resnet50_imagenet2012/run_infer.sh index 14d7faf981e5b9cf7f8c2be0c701d66725c2847a..1482b63f5f6826c1c06427c8445c2fdcd1fe38e1 100755 --- a/example/resnet50_imagenet2012/run_infer.sh +++ b/example/resnet50_imagenet2012/run_infer.sh @@ -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 diff --git a/example/resnet50_imagenet2012/run_standalone_train.sh b/example/resnet50_imagenet2012/run_standalone_train.sh index c4dc95b7ebf8b2289af7a6f923f54ff7c85e42e4..e0eb5efaf0ed7111a371916fb8ab8a4ef9433ff0 100755 --- a/example/resnet50_imagenet2012/run_standalone_train.sh +++ b/example/resnet50_imagenet2012/run_standalone_train.sh @@ -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 &