!3816 If not set pretrained model,we should not be allowed to run training tasks

Merge pull request !3816 from zhouyuanshen/master
This commit is contained in:
mindspore-ci-bot 2020-08-03 16:42:24 +08:00 committed by Gitee
commit e01036f6ca
3 changed files with 18 additions and 34 deletions

View File

@ -94,7 +94,7 @@ sh run_standalone_train.sh [PRETRAINED_MODEL]
```
> Rank_table.json which is specified by RANK_TABLE_FILE is needed when you are running a distribute task. You can generate it by using the [hccl_tools](https://gitee.com/mindspore/mindspore/tree/master/model_zoo/utils/hccl_tools).
> As for PRETRAINED_MODELif not set, the model will be trained from the very beginning.Ready-made pretrained_models are not available now. Stay tuned.
> As for PRETRAINED_MODELit should be a ResNet50 checkpoint that trained over ImageNet2012. Ready-made pretrained_models are not available now. Stay tuned.
#### Result
@ -125,7 +125,7 @@ sh run_eval.sh [VALIDATION_JSON_FILE] [CHECKPOINT_PATH]
#### Result
Inference result will be stored in the example path, whose folder name is "infer". Under this, you can find result like the followings in log.
Inference result will be stored in the example path, whose folder name is "eval". Under this, you can find result like the followings in log.
```
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.360

View File

@ -14,7 +14,7 @@
# limitations under the License.
# ============================================================================
if [ $# -lt 1 ] || [ $# -gt 2 ]
if [ $# -ne 2 ]
then
echo "Usage: sh run_train.sh [RANK_TABLE_FILE] [PRETRAINED_PATH]"
exit 1
@ -37,8 +37,6 @@ then
exit 1
fi
if [ $# == 2 ]
then
PATH2=$(get_real_path $2)
echo $PATH2
if [ ! -f $PATH2 ]
@ -46,7 +44,6 @@ then
echo "error: PRETRAINED_PATH=$PATH2 is not a file"
exit 1
fi
fi
ulimit -u unlimited
export DEVICE_NUM=8
@ -65,11 +62,6 @@ do
cd ./train_parallel$i || exit
echo "start training for rank $RANK_ID, device $DEVICE_ID"
env > env.log
if [ $# == 2 ]
then
python train.py --do_train=True --device_id=$i --rank_id=$i --run_distribute=True --device_num=$DEVICE_NUM --pre_trained=$PATH2 &> log &
else
python train.py --do_train=True --device_id=$i --rank_id=$i --run_distribute=True --device_num=$DEVICE_NUM &> log &
fi
cd ..
done

View File

@ -14,7 +14,7 @@
# limitations under the License.
# ============================================================================
if [ $# -gt 1 ]
if [ $# -ne 1 ]
then
echo "Usage: sh run_standalone_train.sh [PRETRAINED_PATH]"
exit 1
@ -28,8 +28,6 @@ get_real_path(){
fi
}
if [ $# == 1 ]
then
PATH1=$(get_real_path $1)
echo $PATH1
@ -38,7 +36,6 @@ then
echo "error: PRETRAINED_PATH=$PATH1 is not a file"
exit 1
fi
fi
ulimit -u unlimited
export DEVICE_NUM=1
@ -57,10 +54,5 @@ cp -r ../src ./train
cd ./train || exit
echo "start training for device $DEVICE_ID"
env > env.log
if [ $# == 1 ]
then
python train.py --do_train=True --device_id=$DEVICE_ID --pre_trained=$PATH1 &> log &
else
python train.py --do_train=True --device_id=$DEVICE_ID &> log &
fi
cd ..