Browse Source

!6606 add imagenet support for googlenet in shell script.

Merge pull request !6606 from caojian05/ms_master_googlenet_shell_script_support_imagenet
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
5e3cf0d49e
3 changed files with 27 additions and 5 deletions
  1. +12
    -1
      model_zoo/official/cv/googlenet/scripts/run_eval.sh
  2. +14
    -3
      model_zoo/official/cv/googlenet/scripts/run_eval_gpu.sh
  3. +1
    -1
      model_zoo/official/cv/googlenet/scripts/run_train_gpu.sh

+ 12
- 1
model_zoo/official/cv/googlenet/scripts/run_eval.sh View File

@@ -20,4 +20,15 @@ BASEPATH=$(cd "`dirname $0`" || exit; pwd)
export PYTHONPATH=${BASEPATH}:$PYTHONPATH
export DEVICE_ID=0

python ${BASEPATH}/../eval.py > ./eval.log 2>&1 &
dataset_type='cifar10'
if [ $# == 1 ]
then
if [ $1 != "cifar10" ] && [ $1 != "imagenet" ]
then
echo "error: the selected dataset is neither cifar10 nor imagenet"
exit 1
fi
dataset_type=$1
fi

python ${BASEPATH}/../eval.py --dataset_name=$dataset_type > ./eval.log 2>&1 &

+ 14
- 3
model_zoo/official/cv/googlenet/scripts/run_eval_gpu.sh View File

@@ -16,9 +16,9 @@

ulimit -u unlimited

if [ $# != 1 ]
if [ $# != 1 ] && [ $# != 2 ]
then
echo "GPU: sh run_eval_gpu.sh [CHECKPOINT_PATH]"
echo "GPU: sh run_eval_gpu.sh [CHECKPOINT_PATH] [cifar10|imagenet]"
exit 1
fi

@@ -29,6 +29,17 @@ then
exit 1
fi

dataset_type='cifar10'
if [ $# == 2 ]
then
if [ $2 != "cifar10" ] && [ $2 != "imagenet" ]
then
echo "error: the selected dataset is neither cifar10 nor imagenet"
exit 1
fi
dataset_type=$2
fi

BASEPATH=$(cd "`dirname $0`" || exit; pwd)
export PYTHONPATH=${BASEPATH}:$PYTHONPATH
export DEVICE_ID=0
@@ -40,4 +51,4 @@ fi
mkdir ../eval
cd ../eval || exit

python3 ${BASEPATH}/../eval.py --checkpoint_path=$1 > ./eval.log 2>&1 &
python3 ${BASEPATH}/../eval.py --checkpoint_path=$1 --dataset_name=$dataset_type > ./eval.log 2>&1 &

+ 1
- 1
model_zoo/official/cv/googlenet/scripts/run_train_gpu.sh View File

@@ -17,7 +17,7 @@
if [ $# -lt 3 ]
then
echo "Usage: \
sh run_train.sh [DEVICE_NUM] [VISIABLE_DEVICES(0,1,2,3,4,5,6,7)] [cifar10|imagenet]\
sh run_train_gpu.sh [DEVICE_NUM] [VISIABLE_DEVICES(0,1,2,3,4,5,6,7)] [cifar10|imagenet]\
"
exit 1
fi


Loading…
Cancel
Save