From cf9dd0f3bfb7e347ec994d0ffa22de0e958d80dd Mon Sep 17 00:00:00 2001 From: liangyongxiong Date: Fri, 21 Aug 2020 17:20:07 +0800 Subject: [PATCH] update shell script templates of mindwizard --- mindinsight/wizard/README.md | 29 +++++++++++++++---- mindinsight/wizard/README_CN.md | 29 +++++++++++++++---- .../scripts/run_distribute_train.sh-tpl | 2 +- .../scripts/run_distribute_train_gpu.sh-tpl | 2 +- .../network/alexnet/scripts/run_eval.sh-tpl | 2 +- .../alexnet/scripts/run_eval_gpu.sh-tpl | 2 +- .../scripts/run_standalone_train.sh-tpl | 2 +- .../scripts/run_standalone_train_gpu.sh-tpl | 2 +- .../lenet/scripts/run_distribute_train.sh-tpl | 2 +- .../scripts/run_distribute_train_gpu.sh-tpl | 2 +- .../network/lenet/scripts/run_eval.sh-tpl | 2 +- .../network/lenet/scripts/run_eval_gpu.sh-tpl | 2 +- .../lenet/scripts/run_standalone_train.sh-tpl | 2 +- .../scripts/run_standalone_train_gpu.sh-tpl | 2 +- .../scripts/run_distribute_train.sh-tpl | 2 +- .../scripts/run_distribute_train_gpu.sh-tpl | 2 +- .../network/resnet50/scripts/run_eval.sh-tpl | 2 +- .../resnet50/scripts/run_eval_gpu.sh-tpl | 2 +- .../scripts/run_standalone_train.sh-tpl | 2 +- .../scripts/run_standalone_train_gpu.sh-tpl | 2 +- 20 files changed, 64 insertions(+), 30 deletions(-) diff --git a/mindinsight/wizard/README.md b/mindinsight/wizard/README.md index 715f2238..6a3d1ff2 100644 --- a/mindinsight/wizard/README.md +++ b/mindinsight/wizard/README.md @@ -48,6 +48,7 @@ project | |- config.py # parameter configuration | |- dataset.py # data preprocessing | |- lenet.py/resent.py/... # network definition + | |- ... |- eval.py # evaluate network |- train.py # train network |- README.md @@ -78,23 +79,39 @@ $ mindwizard project 1: MNIST [1]: 1 -lenet is generated in $PWD/project +project is generated in $PWD/project $ cd $PWD/project/scripts ``` ### Training +Distributed training + +``` +# Ascend +Usage: bash run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) + +# GPU +Usage: bash run_distribute_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) ``` -# distributed training -Usage: ./run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) -# standalone training -Usage: ./run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) +Standalone training + +``` +# Ascend +Usage: bash run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) + +# GPU +Usage: bash run_standalone_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) ``` ### Evaluation ``` -Usage: ./run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH] +# Ascend +Usage: bash run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH] + +# GPU +Usage: bash run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH] ``` diff --git a/mindinsight/wizard/README_CN.md b/mindinsight/wizard/README_CN.md index 79ada927..4c153be7 100644 --- a/mindinsight/wizard/README_CN.md +++ b/mindinsight/wizard/README_CN.md @@ -48,6 +48,7 @@ project | |- config.py # 参数配置 | |- dataset.py # 数据集处理 | |- lenet.py/resent.py/... # 网络定义 + | |- ... |- eval.py # 网络推理 |- train.py # 网络训练 |- README.md @@ -78,23 +79,39 @@ $ mindwizard project 1: MNIST [1]: 1 -lenet is generated in $PWD/project +project is generated in $PWD/project $ cd $PWD/project/scripts ``` ### 训练 +多卡训练 + +``` +# Ascend +Usage: bash run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) + +# GPU +Usage: bash run_distribute_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) ``` -# 多卡训练 -Usage: ./run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) -# 单卡训练 -Usage: ./run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) +单卡训练 + +``` +# Ascend +Usage: bash run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) + +# GPU +Usage: bash run_standalone_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional) ``` ### 评估 ``` -Usage: ./run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH] +# Ascend +Usage: bash run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH] + +# GPU +Usage: bash run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH] ``` diff --git a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_distribute_train.sh-tpl b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_distribute_train.sh-tpl index 1c2b2ea4..b08fef26 100644 --- a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_distribute_train.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_distribute_train.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 2 ] && [ $# != 3 ] then - echo "Usage: sh run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_distribute_train_gpu.sh-tpl b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_distribute_train_gpu.sh-tpl index 434c1282..88296279 100644 --- a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_distribute_train_gpu.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_distribute_train_gpu.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 1 ] && [ $# != 2 ] then - echo "Usage: sh run_distribute_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_distribute_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_eval.sh-tpl b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_eval.sh-tpl index cc2507e6..7df933f2 100644 --- a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_eval.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_eval.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 2 ] then - echo "Usage: sh run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]" + echo "Usage: bash run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_eval_gpu.sh-tpl b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_eval_gpu.sh-tpl index 6a9e379c..9c0ebfca 100644 --- a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_eval_gpu.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_eval_gpu.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 2 ] then - echo "Usage: sh run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH]" + echo "Usage: bash run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH]" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_standalone_train.sh-tpl b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_standalone_train.sh-tpl index 676e39ec..afe7af32 100644 --- a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_standalone_train.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_standalone_train.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 1 ] && [ $# != 2 ] then - echo "Usage: sh run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_standalone_train_gpu.sh-tpl b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_standalone_train_gpu.sh-tpl index 57e047f9..37664f5e 100644 --- a/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_standalone_train_gpu.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/alexnet/scripts/run_standalone_train_gpu.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 1 ] && [ $# != 2 ] then - echo "Usage: sh run_standalone_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_standalone_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_distribute_train.sh-tpl b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_distribute_train.sh-tpl index 6eff3748..da292eb4 100755 --- a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_distribute_train.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_distribute_train.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 2 ] && [ $# != 3 ] then - echo "Usage: sh run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_distribute_train_gpu.sh-tpl b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_distribute_train_gpu.sh-tpl index b0954f5b..b88fcdc4 100755 --- a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_distribute_train_gpu.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_distribute_train_gpu.sh-tpl @@ -15,7 +15,7 @@ # ============================================================================ if [ $# != 1 ]&& [ $# != 2 ] then - echo "Usage: sh run_distribute_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_distribute_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_eval.sh-tpl b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_eval.sh-tpl index a2cd4624..a9ba6029 100755 --- a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_eval.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_eval.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 2 ] then - echo "Usage: sh run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]" + echo "Usage: bash run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_eval_gpu.sh-tpl b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_eval_gpu.sh-tpl index 5e8f43ff..520de31e 100755 --- a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_eval_gpu.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_eval_gpu.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 2 ] then - echo "Usage: sh run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH]" + echo "Usage: bash run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH]" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_standalone_train.sh-tpl b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_standalone_train.sh-tpl index e610bd06..143a79f9 100755 --- a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_standalone_train.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_standalone_train.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 1 ] && [ $# != 2 ] then - echo "Usage: sh run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_standalone_train_gpu.sh-tpl b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_standalone_train_gpu.sh-tpl index 82525e52..50f530f4 100755 --- a/mindinsight/wizard/conf/templates/network/lenet/scripts/run_standalone_train_gpu.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/lenet/scripts/run_standalone_train_gpu.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 1 ] && [ $# != 2 ] then - echo "Usage: sh run_standalone_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_standalone_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_distribute_train.sh-tpl b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_distribute_train.sh-tpl index 1c2b2ea4..b08fef26 100644 --- a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_distribute_train.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_distribute_train.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 2 ] && [ $# != 3 ] then - echo "Usage: sh run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_distribute_train_gpu.sh-tpl b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_distribute_train_gpu.sh-tpl index 337f2ff2..cd346dc8 100644 --- a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_distribute_train_gpu.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_distribute_train_gpu.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 1 ] && [ $# != 2 ] then - echo "Usage: sh run_distribute_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_distribute_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_eval.sh-tpl b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_eval.sh-tpl index cc2507e6..7df933f2 100644 --- a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_eval.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_eval.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 2 ] then - echo "Usage: sh run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]" + echo "Usage: bash run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_eval_gpu.sh-tpl b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_eval_gpu.sh-tpl index 6a9e379c..9c0ebfca 100644 --- a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_eval_gpu.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_eval_gpu.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 2 ] then - echo "Usage: sh run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH]" + echo "Usage: bash run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH]" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_standalone_train.sh-tpl b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_standalone_train.sh-tpl index 676e39ec..afe7af32 100644 --- a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_standalone_train.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_standalone_train.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 1 ] && [ $# != 2 ] then - echo "Usage: sh run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_standalone_train.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi diff --git a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_standalone_train_gpu.sh-tpl b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_standalone_train_gpu.sh-tpl index 57e047f9..37664f5e 100644 --- a/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_standalone_train_gpu.sh-tpl +++ b/mindinsight/wizard/conf/templates/network/resnet50/scripts/run_standalone_train_gpu.sh-tpl @@ -16,7 +16,7 @@ if [ $# != 1 ] && [ $# != 2 ] then - echo "Usage: sh run_standalone_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" + echo "Usage: bash run_standalone_train_gpu.sh [DATASET_PATH] [PRETRAINED_CKPT_PATH](optional)" exit 1 fi