Browse Source

!6847 modify shell

Merge pull request !6847 from wukesong/alexnet-shell-modify
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
a5737fb976
7 changed files with 52 additions and 24 deletions
  1. +1
    -0
      model_zoo/official/cv/alexnet/eval.py
  2. +2
    -2
      model_zoo/official/cv/alexnet/scripts/run_distribution_ascend.sh
  3. +13
    -4
      model_zoo/official/cv/alexnet/scripts/run_standalone_eval_ascend.sh
  4. +13
    -4
      model_zoo/official/cv/alexnet/scripts/run_standalone_eval_gpu.sh
  5. +11
    -6
      model_zoo/official/cv/alexnet/scripts/run_standalone_train_ascend.sh
  6. +11
    -6
      model_zoo/official/cv/alexnet/scripts/run_standalone_train_gpu.sh
  7. +1
    -2
      model_zoo/official/cv/alexnet/train.py

+ 1
- 0
model_zoo/official/cv/alexnet/eval.py View File

@@ -41,6 +41,7 @@ if __name__ == "__main__":
path where the trained ckpt file')
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
default=True, help='dataset_sink_mode is False or True')
parser.add_argument('--device_id', type=int, default=0, help='device id of GPU or Ascend. (Default: 0)')
args = parser.parse_args()

context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target)


+ 2
- 2
model_zoo/official/cv/alexnet/scripts/run_distribution_ascend.sh View File

@@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# an simple tutorial as follows, more parameters can be setting
if [ $# != 3 ]
then
echo "Usage: sh run_train.sh [RANK_TABLE_FILE] [cifar10|imagenet] [DATA_PATH]"
echo "Usage: sh run_distribution_ascend.sh [RANK_TABLE_FILE] [cifar10|imagenet] [DATA_PATH]"
exit 1
fi



+ 13
- 4
model_zoo/official/cv/alexnet/scripts/run_standalone_eval_ascend.sh View File

@@ -13,8 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================

# an simple tutorial as follows, more parameters can be setting
script_self=$(readlink -f "$0")
self_path=$(dirname "${script_self}")
python -s ${self_path}/../eval.py --device_target="Ascend" > log.txt 2>&1 &
if [ $# != 4 ]
then
echo "Usage: sh run_standalone_eval_ascend.sh [cifar10|imagenet] [DATA_PATH] [CKPT_PATH] [DEVICE_ID]"
exit 1
fi

export DATASET_NAME=$1
export DATA_PATH=$2
export CKPT_PATH=$3
export DEVICE_ID=$4

python eval.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH --ckpt_path=$CKPT_PATH \
--device_id=$DEVICE_ID --device_target="Ascend" > log.txt 2>&1 &

+ 13
- 4
model_zoo/official/cv/alexnet/scripts/run_standalone_eval_gpu.sh View File

@@ -13,8 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================

# an simple tutorial as follows, more parameters can be setting
script_self=$(readlink -f "$0")
self_path=$(dirname "${script_self}")
python -s ${self_path}/../eval.py --device_target="GPU" > log.txt 2>&1 &
if [ $# != 4 ]
then
echo "Usage: sh run_standalone_eval_gpu.sh [cifar10|imagenet] [DATA_PATH] [CKPT_PATH] [DEVICE_ID]"
exit 1
fi

export DATASET_NAME=$1
export DATA_PATH=$2
export CKPT_PATH=$3
export DEVICE_ID=$4

python eval.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH --ckpt_path=$CKPT_PATH \
--device_id=$DEVICE_ID --device_target="GPU" > log.txt 2>&1 &

+ 11
- 6
model_zoo/official/cv/alexnet/scripts/run_standalone_train_ascend.sh View File

@@ -13,11 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# an simple tutorial as follows, more parameters can be setting
if [ $# != 3 ]
then
echo "Usage: sh run_standalone_train_ascend.sh [cifar10|imagenet] [DATA_PATH] [DEVICE_ID]"
exit 1
fi

export DEVICE_NUM=1
export RANK_SIZE=1
export DATASET_NAME=$1
export DATA_PATH=$2
export DEVICE_ID=$3

# an simple tutorial, more
script_self=$(readlink -f "$0")
self_path=$(dirname "${script_self}")
python -s ${self_path}/../train.py --device_target="Ascend" > log.txt 2>&1 &
python train.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH \
--device_id=$DEVICE_ID --device_target="Ascend" > log.txt 2>&1 &

+ 11
- 6
model_zoo/official/cv/alexnet/scripts/run_standalone_train_gpu.sh View File

@@ -13,11 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# an simple tutorial as follows, more parameters can be setting
if [ $# != 3 ]
then
echo "Usage: sh run_standalone_train_gpu.sh [cifar10|imagenet] [DATA_PATH] [DEVICE_ID]"
exit 1
fi

export DEVICE_NUM=1
export RANK_SIZE=1
export DATASET_NAME=$1
export DATA_PATH=$2
export DEVICE_ID=$3

# an simple tutorial as follows, more parameters can be setting
script_self=$(readlink -f "$0")
self_path=$(dirname "${script_self}")
python -s ${self_path}/../train.py --device_target="GPU" > log.txt 2>&1 &
python train.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH \
--device_id=$DEVICE_ID --device_target="GPU" > log.txt 2>&1 &

+ 1
- 2
model_zoo/official/cv/alexnet/train.py View File

@@ -51,8 +51,7 @@ if __name__ == "__main__":
path where the trained ckpt file')
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
default=True, help='dataset_sink_mode is False or True')

parser.add_argument('--device_id', type=int, default=0, help='device id of GPU or Ascend. (Default: None)')
parser.add_argument('--device_id', type=int, default=0, help='device id of GPU or Ascend. (Default: 0)')
args = parser.parse_args()

if args.dataset_name == "cifar10":


Loading…
Cancel
Save