Browse Source

add relative and full path for the eval

tags/v0.3.0-alpha
meixiaowei 6 years ago
parent
commit
1a61073e31
2 changed files with 17 additions and 6 deletions
  1. +0
    -1
      example/resnet101_imagenet2012/README.md
  2. +17
    -5
      example/resnet101_imagenet2012/run_infer.sh

+ 0
- 1
example/resnet101_imagenet2012/README.md 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


+ 17
- 5
example/resnet101_imagenet2012/run_infer.sh 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 ..

Loading…
Cancel
Save