提交 6930c737 编写于 作者: G gengdongjie

bugfix for resnet50_imagenet pretrained_ckpt

上级 705c71a2
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
if [ $# != 2 ] && [ $# != 3 ] if [ $# != 2 ] && [ $# != 3 ]
then then
echo "Usage: sh run_distribute_train.sh [MINDSPORE_HCCL_CONFIG_PATH] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" echo "Usage: sh run_distribute_train.sh [MINDSPORE_HCCL_CONFIG_PATH] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)"
exit 1 exit 1
fi fi
...@@ -32,7 +32,7 @@ PATH1=$(get_real_path $1) ...@@ -32,7 +32,7 @@ PATH1=$(get_real_path $1)
PATH2=$(get_real_path $2) PATH2=$(get_real_path $2)
if [ $# == 3 ] if [ $# == 3 ]
then then
PATH3=$(get_real_path $3) PATH3=$(get_real_path $3)
fi fi
if [ ! -f "$PATH1" ] if [ ! -f "$PATH1" ]
...@@ -47,11 +47,11 @@ then ...@@ -47,11 +47,11 @@ then
exit 1 exit 1
fi fi
if [ ! -f "$PATH3" ] if [ $# == 3 ] && [ ! -f "$PATH3" ]
then then
echo "error: PRETRAINED_CKPT_PATH=$PATH3 is not a file" echo "error: PRETRAINED_CKPT_PATH=$PATH3 is not a file"
exit 1 exit 1
fi fi
ulimit -u unlimited ulimit -u unlimited
export DEVICE_NUM=8 export DEVICE_NUM=8
......
...@@ -34,13 +34,13 @@ PATH2=$(get_real_path $2) ...@@ -34,13 +34,13 @@ PATH2=$(get_real_path $2)
if [ ! -d $PATH1 ] 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 $PATH2 ] 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
......
...@@ -31,17 +31,17 @@ get_real_path(){ ...@@ -31,17 +31,17 @@ get_real_path(){
PATH1=$(get_real_path $1) PATH1=$(get_real_path $1)
if [ $# == 2 ] if [ $# == 2 ]
then then
PATH2=$(get_real_path $2) PATH2=$(get_real_path $2)
fi fi
if [ ! -d "$PATH1" ] if [ ! -d "$PATH1" ]
then then
echo "error: DATASET_PATH=$PATH1 is not a directory" echo "error: DATASET_PATH=$PATH1 is not a directory"
exit 1 exit 1
fi fi
if [ ! -f "$PATH2" ] if [ $# == 2 ] && [ ! -f "$PATH2" ]
then then
echo "error: PRETRAINED_CKPT_PATH=$PATH2 is not a file" echo "error: PRETRAINED_CKPT_PATH=$PATH2 is not a file"
exit 1 exit 1
fi fi
...@@ -62,7 +62,7 @@ cd ./train || exit ...@@ -62,7 +62,7 @@ cd ./train || exit
echo "start training for device $DEVICE_ID" echo "start training for device $DEVICE_ID"
env > env.log env > env.log
if [ $# == 1 ] if [ $# == 1 ]
then then
python train.py --do_train=True --dataset_path=$PATH1 &> log & python train.py --do_train=True --dataset_path=$PATH1 &> log &
else else
python train.py --do_train=True --dataset_path=$PATH1 --pre_trained=$PATH2 &> log & python train.py --do_train=True --dataset_path=$PATH1 --pre_trained=$PATH2 &> log &
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册