diff --git a/example/resnet101_imagenet2012/README.md b/example/resnet101_imagenet2012/README.md index 852326c9d62..8514b8759de 100644 --- a/example/resnet101_imagenet2012/README.md +++ b/example/resnet101_imagenet2012/README.md @@ -25,7 +25,6 @@ This is an example of training ResNet101 with ImageNet dataset in MindSpore. ```shell . ├── crossentropy.py # CrossEntropy loss function -├── var_init.py # weight initial ├── config.py # parameter configuration ├── dataset.py # data preprocessing ├── eval.py # eval net diff --git a/example/resnet101_imagenet2012/run_infer.sh b/example/resnet101_imagenet2012/run_infer.sh index 5df659275e0..b82427e15f0 100755 --- a/example/resnet101_imagenet2012/run_infer.sh +++ b/example/resnet101_imagenet2012/run_infer.sh @@ -20,15 +20,27 @@ then exit 1 fi -if [ ! -d $1 ] +get_real_path(){ + if [ "${1:0:1}" == "/" ]; then + echo "$1" + else + echo "$(realpath -m $PWD/$1)" + fi +} +PATH1=$(get_real_path $1) +PATH2=$(get_real_path $2) +echo $PATH1 +echo $PATH2 + +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 $2 ] +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 @@ -48,5 +60,5 @@ cp *.sh ./infer cd ./infer || exit env > env.log echo "start infering for device $DEVICE_ID" -python eval.py --do_eval=True --dataset_path=$1 --checkpoint_path=$2 &> log & +python eval.py --do_eval=True --dataset_path=$PATH1 --checkpoint_path=$PATH2 &> log & cd ..