!876 support the relative and full paths for eval

Merge pull request !876 from meixiaowei/master
This commit is contained in:
mindspore-ci-bot 2020-04-30 10:05:31 +08:00 committed by Gitee
commit 37e3582794
2 changed files with 17 additions and 6 deletions

View File

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

View File

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