From 55ee90e6965a6b1db844d2fb92b5c6f7bd8e2a46 Mon Sep 17 00:00:00 2001 From: yuchaojie Date: Mon, 19 Oct 2020 15:22:25 +0800 Subject: [PATCH] fix transformer eval device id --- model_zoo/official/nlp/transformer/README.md | 4 ++-- model_zoo/official/nlp/transformer/eval.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/model_zoo/official/nlp/transformer/README.md b/model_zoo/official/nlp/transformer/README.md index a45f2f84ec5..93da3d9e4e1 100644 --- a/model_zoo/official/nlp/transformer/README.md +++ b/model_zoo/official/nlp/transformer/README.md @@ -193,10 +193,10 @@ Parameters for learning rate: - Set options in `config.py`, including loss_scale, learning rate and network hyperparameters. Click [here](https://www.mindspore.cn/tutorial/training/zh-CN/master/use/data_preparation.html) for more information about dataset. -- Run `run_standalone_train_ascend.sh` for non-distributed training of Transformer model. +- Run `run_standalone_train.sh` for non-distributed training of Transformer model. ``` bash - sh scripts/run_standalone_train_ascend.sh DEVICE_ID EPOCH_SIZE DATA_PATH + sh scripts/run_standalone_train.sh DEVICE_TARGET DEVICE_ID EPOCH_SIZE DATA_PATH ``` - Run `run_distribute_train_ascend.sh` for distributed training of Transformer model. diff --git a/model_zoo/official/nlp/transformer/eval.py b/model_zoo/official/nlp/transformer/eval.py index c2948cbbb3a..6d4b6632f9b 100644 --- a/model_zoo/official/nlp/transformer/eval.py +++ b/model_zoo/official/nlp/transformer/eval.py @@ -100,7 +100,7 @@ def run_transformer_eval(): parser = argparse.ArgumentParser(description='tranformer') parser.add_argument("--device_target", type=str, default="Ascend", help="device where the code will be implemented, default is Ascend") - parser.add_argument('--device_id', type=int, default=None, 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 is 0') args = parser.parse_args() context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target, reserve_class_name_in_scope=False,