pretrained_model must be set when run training tasks

This commit is contained in:
zhouyuanshen 2020-07-31 16:31:05 +08:00
parent 6adcb5a859
commit e78372b101
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,15 +37,12 @@ then
exit 1
fi
if [ $# == 2 ]
then
PATH2=$(get_real_path $2)
echo $PATH2
if [ ! -f $PATH2 ]
then
echo "error: PRETRAINED_PATH=$PATH2 is not a file"
exit 1
fi
PATH2=$(get_real_path $2)
echo $PATH2
if [ ! -f $PATH2 ]
then
echo "error: PRETRAINED_PATH=$PATH2 is not a file"
exit 1
fi
ulimit -u unlimited
@ -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
python train.py --do_train=True --device_id=$i --rank_id=$i --run_distribute=True --device_num=$DEVICE_NUM --pre_trained=$PATH2 &> log &
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,16 +28,13 @@ get_real_path(){
fi
}
if [ $# == 1 ]
then
PATH1=$(get_real_path $1)
echo $PATH1
PATH1=$(get_real_path $1)
echo $PATH1
if [ ! -f $PATH1 ]
then
echo "error: PRETRAINED_PATH=$PATH1 is not a file"
exit 1
fi
if [ ! -f $PATH1 ]
then
echo "error: PRETRAINED_PATH=$PATH1 is not a file"
exit 1
fi
ulimit -u unlimited
@ -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
python train.py --do_train=True --device_id=$DEVICE_ID --pre_trained=$PATH1 &> log &
cd ..