forked from mindspore-Ecosystem/mindspore
!876 support the relative and full paths for eval
Merge pull request !876 from meixiaowei/master
This commit is contained in:
commit
37e3582794
|
@ -25,7 +25,6 @@ This is an example of training ResNet101 with ImageNet dataset in MindSpore.
|
||||||
```shell
|
```shell
|
||||||
.
|
.
|
||||||
├── crossentropy.py # CrossEntropy loss function
|
├── crossentropy.py # CrossEntropy loss function
|
||||||
├── var_init.py # weight initial
|
|
||||||
├── config.py # parameter configuration
|
├── config.py # parameter configuration
|
||||||
├── dataset.py # data preprocessing
|
├── dataset.py # data preprocessing
|
||||||
├── eval.py # eval net
|
├── eval.py # eval net
|
||||||
|
|
|
@ -20,15 +20,27 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
then
|
||||||
echo "error: DATASET_PATH=$1 is not a directory"
|
echo "error: DATASET_PATH=$PATH1 is not a directory"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $2 ]
|
if [ ! -f $PATH2 ]
|
||||||
then
|
then
|
||||||
echo "error: CHECKPOINT_PATH=$2 is not a file"
|
echo "error: CHECKPOINT_PATH=$PATH2 is not a file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -48,5 +60,5 @@ cp *.sh ./infer
|
||||||
cd ./infer || exit
|
cd ./infer || exit
|
||||||
env > env.log
|
env > env.log
|
||||||
echo "start infering for device $DEVICE_ID"
|
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 ..
|
cd ..
|
||||||
|
|
Loading…
Reference in New Issue