提交 1a61073e 编写于 作者: M meixiaowei

add relative and full path for the eval

上级 8af10eb5
......@@ -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
......
......@@ -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 ..
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册