From cad462902a18f58ac1f0630a86edeafba5edd225 Mon Sep 17 00:00:00 2001 From: caojiewen Date: Tue, 23 Mar 2021 11:13:02 +0800 Subject: [PATCH] fixed the code spell errors. --- .../official/cv/FCN8s/scripts/run_eval.sh | 2 +- model_zoo/official/cv/alexnet/eval.py | 2 +- model_zoo/official/cv/alexnet/train.py | 6 ++--- .../official/cv/centerface/src/var_init.py | 2 +- .../cv/psenet/src/ETSNET/pse/adaptor.cpp | 26 +++++++++---------- .../cv/ssd/scripts/run_distribute_train.sh | 4 +-- .../ssd/scripts/run_distribute_train_gpu.sh | 4 +-- model_zoo/official/cv/ssd/scripts/run_eval.sh | 2 +- .../official/cv/ssd/scripts/run_eval_gpu.sh | 2 +- .../scripts/run_distribute_pretrain.sh | 2 +- .../scripts/run_standalone_pretrain.sh | 2 +- .../official/nlp/bert_thor/src/model_thor.py | 4 +-- model_zoo/official/nlp/bert_thor/src/utils.py | 2 +- model_zoo/official/nlp/fasttext/README.md | 4 +-- .../nlp/fasttext/scripts/create_dataset.sh | 2 +- .../scripts/run_distribute_train_8p.sh | 2 +- .../official/nlp/fasttext/scripts/run_eval.sh | 2 +- .../fasttext/scripts/run_standalone_train.sh | 2 +- .../nlp/fasttext/src/fasttext_model.py | 6 ++--- model_zoo/official/nlp/fasttext/train.py | 2 +- .../official/nlp/gpt/scripts/pre_process.sh | 2 +- .../nlp/gpt/scripts/run_distribute_train.sh | 2 +- .../nlp/gpt/scripts/run_evaluation.sh | 2 +- .../nlp/gpt/scripts/run_standalone_train.sh | 2 +- model_zoo/official/nlp/gpt/src/dataset.py | 2 +- model_zoo/official/nlp/lstm/README.md | 12 ++++----- model_zoo/official/nlp/mass/README.md | 4 +-- .../official/nlp/mass/src/utils/eval_score.py | 2 +- model_zoo/official/nlp/prophetnet/README.md | 4 +-- .../nlp/prophetnet/src/utils/eval_score.py | 2 +- model_zoo/official/nlp/textcnn/README.md | 2 +- .../scripts/run_distributed_gd_ascend.sh | 2 +- .../scripts/run_distributed_gd_gpu.sh | 2 +- .../nlp/tinybert/scripts/run_standalone_gd.sh | 2 +- .../nlp/tinybert/scripts/run_standalone_td.sh | 6 ++--- .../official/nlp/tinybert/src/td_config.py | 2 +- .../nlp/transformer/scripts/process_output.sh | 2 +- .../scripts/run_distribute_train_ascend.sh | 2 +- .../scripts/run_distribute_train_gpu.sh | 2 +- .../nlp/transformer/scripts/run_eval.sh | 2 +- model_zoo/official/recommend/deepfm/README.md | 2 +- .../recommend/wide_and_deep/README.md | 4 +-- .../recommend/wide_and_deep/README_CN.md | 2 +- .../recommend/wide_and_deep/src/datasets.py | 2 +- model_zoo/research/audio/fcn-4/eval.py | 2 +- model_zoo/research/cv/ghostnet/eval.py | 2 +- model_zoo/research/cv/ghostnet/src/dataset.py | 2 +- model_zoo/research/cv/ghostnet/src/launch.py | 2 +- model_zoo/research/cv/ghostnet_quant/eval.py | 2 +- .../research/cv/ghostnet_quant/src/dataset.py | 2 +- .../research/cv/ghostnet_quant/src/launch.py | 2 +- .../research/cv/resnet50_adv_pruning/eval.py | 2 +- .../resnet50_adv_pruning/src/pet_dataset.py | 2 +- model_zoo/research/cv/squeezenet/README.md | 2 +- model_zoo/research/cv/ssd_ghostnet/README.md | 2 +- .../scripts/run_distribute_train_ghostnet.sh | 4 +-- model_zoo/research/cv/tinynet/src/dataset.py | 4 +-- model_zoo/research/hpc/ocean_model/README.md | 2 +- .../research/hpc/ocean_model/src/GOMO.py | 4 +-- model_zoo/research/nlp/dscnn/README.md | 4 +-- model_zoo/research/rl/ldp_linucb/README.md | 6 ++--- model_zoo/utils/hccl_tools/hccl_tools.py | 2 +- 62 files changed, 98 insertions(+), 98 deletions(-) diff --git a/model_zoo/official/cv/FCN8s/scripts/run_eval.sh b/model_zoo/official/cv/FCN8s/scripts/run_eval.sh index 60b2edebe1..6e9ec6b4cc 100644 --- a/model_zoo/official/cv/FCN8s/scripts/run_eval.sh +++ b/model_zoo/official/cv/FCN8s/scripts/run_eval.sh @@ -16,7 +16,7 @@ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "sh run_distribute_eval.sh DEVICE_NUM RANK_TABLE_FILE DATASET CKPT_PATH" echo "for example: sh run_eval.sh [RANK_TABLE_FILE] /path/to/dataset /path/to/ckpt device_id" echo "It is better to use absolute path." diff --git a/model_zoo/official/cv/alexnet/eval.py b/model_zoo/official/cv/alexnet/eval.py index 69ce802109..2cb7dfcbf4 100644 --- a/model_zoo/official/cv/alexnet/eval.py +++ b/model_zoo/official/cv/alexnet/eval.py @@ -76,7 +76,7 @@ if __name__ == "__main__": model = Model(network, loss_fn=loss, metrics={'top_1_accuracy', 'top_5_accuracy'}) else: - raise ValueError("Unsupport dataset.") + raise ValueError("Unsupported dataset.") if ds_eval.get_dataset_size() == 0: raise ValueError("Please check dataset size > 0 and batch_size <= dataset size") diff --git a/model_zoo/official/cv/alexnet/train.py b/model_zoo/official/cv/alexnet/train.py index cf0c2453eb..d546ff2cfa 100644 --- a/model_zoo/official/cv/alexnet/train.py +++ b/model_zoo/official/cv/alexnet/train.py @@ -64,7 +64,7 @@ if __name__ == "__main__": elif args.dataset_name == "imagenet": cfg = alexnet_imagenet_cfg else: - raise ValueError("Unsupport dataset.") + raise ValueError("Unsupported dataset.") device_target = args.device_target context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target) @@ -92,7 +92,7 @@ if __name__ == "__main__": elif args.dataset_name == "imagenet": ds_train = create_dataset_imagenet(args.data_path, cfg.batch_size) else: - raise ValueError("Unsupport dataset.") + raise ValueError("Unsupported dataset.") if ds_train.get_dataset_size() == 0: raise ValueError("Please check dataset size > 0 and batch_size <= dataset size") @@ -124,7 +124,7 @@ if __name__ == "__main__": loss_scale_manager = FixedLossScaleManager(cfg.loss_scale, drop_overflow_update=False) else: - raise ValueError("Unsupport dataset.") + raise ValueError("Unsupported dataset.") if device_target == "Ascend": model = Model(network, loss_fn=loss, optimizer=opt, metrics=metrics, amp_level="O2", keep_batchnorm_fp32=False, diff --git a/model_zoo/official/cv/centerface/src/var_init.py b/model_zoo/official/cv/centerface/src/var_init.py index 5c1b780c77..8f084ac314 100644 --- a/model_zoo/official/cv/centerface/src/var_init.py +++ b/model_zoo/official/cv/centerface/src/var_init.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ -"""weight initilization""" +"""weight initialization""" import math import numpy as np diff --git a/model_zoo/official/cv/psenet/src/ETSNET/pse/adaptor.cpp b/model_zoo/official/cv/psenet/src/ETSNET/pse/adaptor.cpp index 0922d9f8cf..6d9897c80d 100644 --- a/model_zoo/official/cv/psenet/src/ETSNET/pse/adaptor.cpp +++ b/model_zoo/official/cv/psenet/src/ETSNET/pse/adaptor.cpp @@ -35,21 +35,21 @@ using cv::Point; namespace py = pybind11; namespace pse_adaptor { - void get_kernals(const int *data, vector data_shape, vector *kernals) { + void get_kernels(const int *data, vector data_shape, vector *kernels) { for (int i = 0; i < data_shape[0]; ++i) { - Mat kernal = Mat::zeros(data_shape[1], data_shape[2], CV_8UC1); - for (int x = 0; x < kernal.rows; ++x) { - for (int y = 0; y < kernal.cols; ++y) { - kernal.at(x, y) = data[i * data_shape[1] * data_shape[2] + x * data_shape[2] + y]; + Mat kernel = Mat::zeros(data_shape[1], data_shape[2], CV_8UC1); + for (int x = 0; x < kernel.rows; ++x) { + for (int y = 0; y < kernel.cols; ++y) { + kernel.at(x, y) = data[i * data_shape[1] * data_shape[2] + x * data_shape[2] + y]; } } - kernals->emplace_back(kernal); + kernels->emplace_back(kernel); } } - void growing_text_line(const vector &kernals, vector> *text_line, float min_area) { + void growing_text_line(const vector &kernels, vector> *text_line, float min_area) { Mat label_mat; - int label_num = connectedComponents(kernals[kernals.size() - 1], label_mat, 4); + int label_num = connectedComponents(kernels[kernels.size() - 1], label_mat, 4); vector area(label_num + 1, 0); for (int x = 0; x < label_mat.rows; ++x) { for (int y = 0; y < label_mat.cols; ++y) { @@ -76,7 +76,7 @@ namespace pse_adaptor { int dx[] = {-1, 1, 0, 0}; int dy[] = {0, 0, -1, 1}; - for (int kernal_id = kernals.size() - 2; kernal_id >= 0; --kernal_id) { + for (int kernal_id = kernels.size() - 2; kernal_id >= 0; --kernal_id) { while (!queue.empty()) { Point point = queue.front(); queue.pop(); @@ -90,7 +90,7 @@ namespace pse_adaptor { if (tmp_x < 0 || tmp_x >= static_cast(text_line->size())) continue; if (tmp_y < 0 || tmp_y >= static_cast(text_line->at(1).size())) continue; - if (kernals[kernal_id].at(tmp_x, tmp_y) == 0) continue; + if (kernels[kernal_id].at(tmp_x, tmp_y) == 0) continue; if (text_line->at(tmp_x)[tmp_y] > 0) continue; Point point_tmp(tmp_x, tmp_y); @@ -110,10 +110,10 @@ namespace pse_adaptor { vector> pse(py::array_t quad_n9, float min_area) { auto buf = quad_n9.request(); auto data = static_cast(buf.ptr); - vector kernals; - get_kernals(data, buf.shape, &kernals); + vector kernels; + get_kernels(data, buf.shape, &kernels); vector> text_line; - growing_text_line(kernals, &text_line, min_area); + growing_text_line(kernels, &text_line, min_area); return text_line; } diff --git a/model_zoo/official/cv/ssd/scripts/run_distribute_train.sh b/model_zoo/official/cv/ssd/scripts/run_distribute_train.sh index f7a3694548..44235b195e 100644 --- a/model_zoo/official/cv/ssd/scripts/run_distribute_train.sh +++ b/model_zoo/official/cv/ssd/scripts/run_distribute_train.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "sh run_distribute_train.sh DEVICE_NUM EPOCH_SIZE LR DATASET RANK_TABLE_FILE PRE_TRAINED PRE_TRAINED_EPOCH_SIZE" echo "for example: sh run_distribute_train.sh 8 500 0.2 coco /data/hccl.json /opt/ssd-300.ckpt(optional) 200(optional)" echo "It is better to use absolute path." @@ -33,7 +33,7 @@ BASE_PATH=$(cd "`dirname $0`" || exit; pwd) cd $BASE_PATH/../ || exit python train.py --only_create_dataset=True --dataset=$4 -echo "After running the scipt, the network runs in the background. The log will be generated in LOGx/log.txt" +echo "After running the script, the network runs in the background. The log will be generated in LOGx/log.txt" export RANK_SIZE=$1 EPOCH_SIZE=$2 diff --git a/model_zoo/official/cv/ssd/scripts/run_distribute_train_gpu.sh b/model_zoo/official/cv/ssd/scripts/run_distribute_train_gpu.sh index 9277e3de69..a72c257570 100644 --- a/model_zoo/official/cv/ssd/scripts/run_distribute_train_gpu.sh +++ b/model_zoo/official/cv/ssd/scripts/run_distribute_train_gpu.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "sh run_distribute_train_gpu.sh DEVICE_NUM EPOCH_SIZE LR DATASET PRE_TRAINED PRE_TRAINED_EPOCH_SIZE" echo "for example: sh run_distribute_train_gpu.sh 8 500 0.2 coco /opt/ssd-300.ckpt(optional) 200(optional)" echo "It is better to use absolute path." @@ -33,7 +33,7 @@ BASE_PATH=$(cd "`dirname $0`" || exit; pwd) cd $BASE_PATH/../ || exit python train.py --only_create_dataset=True --run_platform="GPU" --dataset=$4 -echo "After running the scipt, the network runs in the background. The log will be generated in LOG/log.txt" +echo "After running the script, the network runs in the background. The log will be generated in LOG/log.txt" export RANK_SIZE=$1 EPOCH_SIZE=$2 diff --git a/model_zoo/official/cv/ssd/scripts/run_eval.sh b/model_zoo/official/cv/ssd/scripts/run_eval.sh index 4210b44129..1680c032ed 100644 --- a/model_zoo/official/cv/ssd/scripts/run_eval.sh +++ b/model_zoo/official/cv/ssd/scripts/run_eval.sh @@ -57,7 +57,7 @@ cp ./*.py ./eval$3 cp -r ./src ./eval$3 cd ./eval$3 || exit env > env.log -echo "start infering for device $DEVICE_ID" +echo "start inferring for device $DEVICE_ID" python eval.py \ --dataset=$DATASET \ --checkpoint_path=$CHECKPOINT_PATH \ diff --git a/model_zoo/official/cv/ssd/scripts/run_eval_gpu.sh b/model_zoo/official/cv/ssd/scripts/run_eval_gpu.sh index a46fc8aced..5c69d86276 100644 --- a/model_zoo/official/cv/ssd/scripts/run_eval_gpu.sh +++ b/model_zoo/official/cv/ssd/scripts/run_eval_gpu.sh @@ -57,7 +57,7 @@ cp ./*.py ./eval$3 cp -r ./src ./eval$3 cd ./eval$3 || exit env > env.log -echo "start infering for device $DEVICE_ID" +echo "start inferring for device $DEVICE_ID" python eval.py \ --dataset=$DATASET \ --checkpoint_path=$CHECKPOINT_PATH \ diff --git a/model_zoo/official/nlp/bert_thor/scripts/run_distribute_pretrain.sh b/model_zoo/official/nlp/bert_thor/scripts/run_distribute_pretrain.sh index 1b695fd28c..34508ac51f 100644 --- a/model_zoo/official/nlp/bert_thor/scripts/run_distribute_pretrain.sh +++ b/model_zoo/official/nlp/bert_thor/scripts/run_distribute_pretrain.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "bash run_distribute_pretrain.sh DEVICE_NUM EPOCH_SIZE DATA_DIR SCHEMA_DIR RANK_TABLE_FILE" echo "for example: bash run_distribute_pretrain.sh 8 1 /path/zh-wiki/ /path/Schema.json /path/hccl.json" echo "It is better to use absolute path." diff --git a/model_zoo/official/nlp/bert_thor/scripts/run_standalone_pretrain.sh b/model_zoo/official/nlp/bert_thor/scripts/run_standalone_pretrain.sh index 87098430f0..a92ecacfb7 100644 --- a/model_zoo/official/nlp/bert_thor/scripts/run_standalone_pretrain.sh +++ b/model_zoo/official/nlp/bert_thor/scripts/run_standalone_pretrain.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "bash run_standalone_pretrain.sh DEVICE_ID EPOCH_SIZE DATA_DIR SCHEMA_DIR" echo "for example: bash run_standalone_pretrain.sh 0 40 /path/zh-wiki/ /path/Schema.json" echo "==============================================================================================================" diff --git a/model_zoo/official/nlp/bert_thor/src/model_thor.py b/model_zoo/official/nlp/bert_thor/src/model_thor.py index 220e625101..2f76483356 100644 --- a/model_zoo/official/nlp/bert_thor/src/model_thor.py +++ b/model_zoo/official/nlp/bert_thor/src/model_thor.py @@ -585,7 +585,7 @@ class Model: returned and passed to the network. Otherwise, a tuple (data, label) should be returned, and the data and label are passed to the network and loss function respectively. - callbacks (list): List of callback object. Callbacks which should be excuted while training. Default: None. + callbacks (list): List of callback object. Callbacks which should be executed while training. Default: None. dataset_sink_mode (bool): Determines whether to pass the data through dataset channel. Default: True. Configure pynative mode, the training process will be performed with dataset not sink. @@ -704,7 +704,7 @@ class Model: Args: valid_dataset (Dataset): Dataset to evaluate the model. - callbacks (list): List of callback object. Callbacks which should be excuted + callbacks (list): List of callback object. Callbacks which should be executed while training. Default: None. dataset_sink_mode (bool): Determines whether to pass the data through dataset channel. Default: True. diff --git a/model_zoo/official/nlp/bert_thor/src/utils.py b/model_zoo/official/nlp/bert_thor/src/utils.py index 6bed08c8de..5205200153 100644 --- a/model_zoo/official/nlp/bert_thor/src/utils.py +++ b/model_zoo/official/nlp/bert_thor/src/utils.py @@ -65,7 +65,7 @@ def make_directory(path: str): """Make directory.""" if path is None or not isinstance(path, str) or path.strip() == "": logger.error("The path(%r) is invalid type.", path) - raise TypeError("Input path is invaild type") + raise TypeError("Input path is invalid type") # convert the relative paths path = os.path.realpath(path) diff --git a/model_zoo/official/nlp/fasttext/README.md b/model_zoo/official/nlp/fasttext/README.md index 276ac4c99d..24fa09f67e 100644 --- a/model_zoo/official/nlp/fasttext/README.md +++ b/model_zoo/official/nlp/fasttext/README.md @@ -25,9 +25,9 @@ # [FastText](#contents) FastText is a fast text classification algorithm, which is simple and efficient. It was proposed by Armand -Joulin, Tomas Mikolov etc. in the artical "Bag of Tricks for Efficient Text Classification" in 2016. It is similar to +Joulin, Tomas Mikolov etc. in the article "Bag of Tricks for Efficient Text Classification" in 2016. It is similar to CBOW in model architecture, where the middle word is replace by a label. FastText adopts ngram feature as addition feature -to get some information about words. It speeds up training and testing while maintaining high percision, and widly used +to get some information about words. It speeds up training and testing while maintaining high precision, and widly used in various tasks of text classification. [Paper](https://arxiv.org/pdf/1607.01759.pdf): "Bag of Tricks for Efficient Text Classification", 2016, A. Joulin, E. Grave, P. Bojanowski, and T. Mikolov diff --git a/model_zoo/official/nlp/fasttext/scripts/create_dataset.sh b/model_zoo/official/nlp/fasttext/scripts/create_dataset.sh index 4573b438b9..425ae6dc1c 100644 --- a/model_zoo/official/nlp/fasttext/scripts/create_dataset.sh +++ b/model_zoo/official/nlp/fasttext/scripts/create_dataset.sh @@ -14,7 +14,7 @@ # limitations under the License. # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "sh create_dataset.sh SOURCE_DATASET_PATH DATASET_NAME" echo "for example: sh create_dataset.sh /home/workspace/ag_news_csv ag" echo "DATASET_NAME including ag, dbpedia, and yelp_p" diff --git a/model_zoo/official/nlp/fasttext/scripts/run_distribute_train_8p.sh b/model_zoo/official/nlp/fasttext/scripts/run_distribute_train_8p.sh index ab5469d438..5d7078efa0 100644 --- a/model_zoo/official/nlp/fasttext/scripts/run_distribute_train_8p.sh +++ b/model_zoo/official/nlp/fasttext/scripts/run_distribute_train_8p.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "sh run_distributed_train.sh DATASET_PATH RANK_TABLE_PATH" echo "for example: sh run_distributed_train.sh /home/workspace/ag /home/workspace/rank_table_file.json" echo "It is better to use absolute path." diff --git a/model_zoo/official/nlp/fasttext/scripts/run_eval.sh b/model_zoo/official/nlp/fasttext/scripts/run_eval.sh index 85b90f4fb2..aba2329252 100644 --- a/model_zoo/official/nlp/fasttext/scripts/run_eval.sh +++ b/model_zoo/official/nlp/fasttext/scripts/run_eval.sh @@ -14,7 +14,7 @@ # limitations under the License. # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "sh run_eval.sh DATASET_PATH DATASET_NAME MODEL_CKPT" echo "for example: sh run_eval.sh /home/workspace/ag/test*.mindrecord ag device0/ckpt0/fasttext-5-118.ckpt" echo "It is better to use absolute path." diff --git a/model_zoo/official/nlp/fasttext/scripts/run_standalone_train.sh b/model_zoo/official/nlp/fasttext/scripts/run_standalone_train.sh index fd62e6c410..f0c5628372 100644 --- a/model_zoo/official/nlp/fasttext/scripts/run_standalone_train.sh +++ b/model_zoo/official/nlp/fasttext/scripts/run_standalone_train.sh @@ -14,7 +14,7 @@ # limitations under the License. # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "sh run_standalone_train.sh DATASET_PATH" echo "for example: sh run_standalone_train.sh /home/workspace/ag" echo "It is better to use absolute path." diff --git a/model_zoo/official/nlp/fasttext/src/fasttext_model.py b/model_zoo/official/nlp/fasttext/src/fasttext_model.py index a1dddd894e..5867807695 100644 --- a/model_zoo/official/nlp/fasttext/src/fasttext_model.py +++ b/model_zoo/official/nlp/fasttext/src/fasttext_model.py @@ -62,7 +62,7 @@ class FastText(nn.Cell): embeding = self.realdiv(embeding, src_token_length) embeding = self.cast(embeding, mstype.float16) - classifer = self.fc(embeding) - classifer = self.cast(classifer, mstype.float32) + classifier = self.fc(embeding) + classifier = self.cast(classifier, mstype.float32) - return classifer + return classifier diff --git a/model_zoo/official/nlp/fasttext/train.py b/model_zoo/official/nlp/fasttext/train.py index a399502af2..51446d092e 100644 --- a/model_zoo/official/nlp/fasttext/train.py +++ b/model_zoo/official/nlp/fasttext/train.py @@ -184,7 +184,7 @@ def train_paralle(input_file_path): input_file_path: preprocessed dataset path """ set_parallel_env() - print("Starting traning on mutiple devices. |~ _ ~| |~ _ ~| |~ _ ~| |~ _ ~|") + print("Starting traning on multiple devices. |~ _ ~| |~ _ ~| |~ _ ~| |~ _ ~|") preprocessed_data = load_dataset(dataset_path=input_file_path, batch_size=config.batch_size, epoch_count=config.epoch_count, diff --git a/model_zoo/official/nlp/gpt/scripts/pre_process.sh b/model_zoo/official/nlp/gpt/scripts/pre_process.sh index f26c2f2c9c..10c75ad6e6 100644 --- a/model_zoo/official/nlp/gpt/scripts/pre_process.sh +++ b/model_zoo/official/nlp/gpt/scripts/pre_process.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "bash script/pre_process.sh \"INPUT_GLOB\" DATASET_TYPE OUTPUT_FILE" echo "for example: bash script/pre_process.sh \"dataset/*.output\" openwebtext ./output/openwebtext.mindrecord" echo "==============================================================================================================" diff --git a/model_zoo/official/nlp/gpt/scripts/run_distribute_train.sh b/model_zoo/official/nlp/gpt/scripts/run_distribute_train.sh index 49174e79a4..d445faa432 100644 --- a/model_zoo/official/nlp/gpt/scripts/run_distribute_train.sh +++ b/model_zoo/official/nlp/gpt/scripts/run_distribute_train.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "bash run_distributed_pretrain_ascend.sh DATA_DIR RANK_TABLE_FILE DEVICE_NUM" echo "for example: bash run_distributed_pretrain_ascend.sh /path/dataset /path/hccl.json 8" echo "It is better to use absolute path." diff --git a/model_zoo/official/nlp/gpt/scripts/run_evaluation.sh b/model_zoo/official/nlp/gpt/scripts/run_evaluation.sh index d750484ae3..2816d446b7 100644 --- a/model_zoo/official/nlp/gpt/scripts/run_evaluation.sh +++ b/model_zoo/official/nlp/gpt/scripts/run_evaluation.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "bash scripts/run_evaluation.sh TASK_TYPE CKPT_PATH DATA_PATH METRICS" echo "for example: bash scripts/run_evaluation.sh lambada /your/ckpt /your/data acc" echo "==============================================================================================================" diff --git a/model_zoo/official/nlp/gpt/scripts/run_standalone_train.sh b/model_zoo/official/nlp/gpt/scripts/run_standalone_train.sh index 03dbb91b9c..b62ed1abfe 100644 --- a/model_zoo/official/nlp/gpt/scripts/run_standalone_train.sh +++ b/model_zoo/official/nlp/gpt/scripts/run_standalone_train.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "bash run_standalone_pretrain_ascend.sh DEVICE_ID EPOCH_SIZE DATA_DIR" echo "for example: bash run_standalone_pretrain_ascend.sh 0 40 /path/zh-wiki/" echo "==============================================================================================================" diff --git a/model_zoo/official/nlp/gpt/src/dataset.py b/model_zoo/official/nlp/gpt/src/dataset.py index 7088443895..e4609fd075 100644 --- a/model_zoo/official/nlp/gpt/src/dataset.py +++ b/model_zoo/official/nlp/gpt/src/dataset.py @@ -14,7 +14,7 @@ # ============================================================================ """ -Create dataset for training and evaluting +Create dataset for training and evaluating """ import os diff --git a/model_zoo/official/nlp/lstm/README.md b/model_zoo/official/nlp/lstm/README.md index 9f4b0a505a..c8889a76af 100644 --- a/model_zoo/official/nlp/lstm/README.md +++ b/model_zoo/official/nlp/lstm/README.md @@ -48,7 +48,7 @@ Note that you can run the scripts based on the dataset mentioned in original pap # [Quick Start](#contents) -- runing on Ascend +- running on Ascend ```bash # run training example @@ -58,7 +58,7 @@ Note that you can run the scripts based on the dataset mentioned in original pap bash run_eval_ascend.sh 0 ./preprocess lstm-20_390.ckpt ``` -- runing on GPU +- running on GPU ```bash # run training example @@ -68,7 +68,7 @@ Note that you can run the scripts based on the dataset mentioned in original pap bash run_eval_gpu.sh 0 ./aclimdb ./glove_dir lstm-20_390.ckpt ``` -- runing on CPU +- running on CPU ```bash # run training example @@ -200,7 +200,7 @@ Ascend: - Set options in `config.py`, including learning rate and network hyperparameters. -- runing on Ascend +- running on Ascend Run `sh run_train_ascend.sh` for training. @@ -217,7 +217,7 @@ Ascend: ... ``` -- runing on GPU +- running on GPU Run `sh run_train_gpu.sh` for training. @@ -234,7 +234,7 @@ Ascend: ... ``` -- runing on CPU +- running on CPU Run `sh run_train_cpu.sh` for training. diff --git a/model_zoo/official/nlp/mass/README.md b/model_zoo/official/nlp/mass/README.md index e03bfba4be..4b33fba44e 100644 --- a/model_zoo/official/nlp/mass/README.md +++ b/model_zoo/official/nlp/mass/README.md @@ -349,7 +349,7 @@ GPU: sh run_gpu.sh [--options] ``` -The usage of `run_ascend.sh` is shown as bellow: +The usage of `run_ascend.sh` is shown as below: ```text Usage: run_ascend.sh [-h, --help] [-t, --task ] [-n, --device_num ] @@ -371,7 +371,7 @@ options: Notes: Be sure to assign the hccl_json file while running a distributed-training. -The usage of `run_gpu.sh` is shown as bellow: +The usage of `run_gpu.sh` is shown as below: ```text Usage: run_gpu.sh [-h, --help] [-t, --task ] [-n, --device_num ] diff --git a/model_zoo/official/nlp/mass/src/utils/eval_score.py b/model_zoo/official/nlp/mass/src/utils/eval_score.py index 30ff0b2208..f624b3d43b 100644 --- a/model_zoo/official/nlp/mass/src/utils/eval_score.py +++ b/model_zoo/official/nlp/mass/src/utils/eval_score.py @@ -54,7 +54,7 @@ def get_rouge_score(result, vocab): "target", "prediction" and "prediction_prob". Dictionary, dict instance. - retur: + return: Str, rouge score. """ diff --git a/model_zoo/official/nlp/prophetnet/README.md b/model_zoo/official/nlp/prophetnet/README.md index b4f2a3c742..6c8220824d 100644 --- a/model_zoo/official/nlp/prophetnet/README.md +++ b/model_zoo/official/nlp/prophetnet/README.md @@ -340,7 +340,7 @@ GPU: sh run_gpu.sh [--options] ``` -The usage of `run_ascend.sh` is shown as bellow: +The usage of `run_ascend.sh` is shown as below: ```text Usage: run_ascend.sh [-h, --help] [-t, --task ] [-n, --device_num ] @@ -362,7 +362,7 @@ options: Notes: Be sure to assign the hccl_json file while running a distributed-training. -The usage of `run_gpu.sh` is shown as bellow: +The usage of `run_gpu.sh` is shown as below: ```text Usage: run_gpu.sh [-h, --help] [-t, --task ] [-n, --device_num ] diff --git a/model_zoo/official/nlp/prophetnet/src/utils/eval_score.py b/model_zoo/official/nlp/prophetnet/src/utils/eval_score.py index 30ff0b2208..f624b3d43b 100644 --- a/model_zoo/official/nlp/prophetnet/src/utils/eval_score.py +++ b/model_zoo/official/nlp/prophetnet/src/utils/eval_score.py @@ -54,7 +54,7 @@ def get_rouge_score(result, vocab): "target", "prediction" and "prediction_prob". Dictionary, dict instance. - retur: + return: Str, rouge score. """ diff --git a/model_zoo/official/nlp/textcnn/README.md b/model_zoo/official/nlp/textcnn/README.md index 4519aaca20..7110530368 100644 --- a/model_zoo/official/nlp/textcnn/README.md +++ b/model_zoo/official/nlp/textcnn/README.md @@ -51,7 +51,7 @@ Dataset used: [Movie Review Data](>> parse_args() """ parser = ArgumentParser(description="mindspore distributed training launch " - "helper utilty that will spawn up " + "helper utility that will spawn up " "multiple distributed processes") parser.add_argument("--nproc_per_node", type=int, default=1, help="The number of processes to launch on each node, " diff --git a/model_zoo/research/cv/ghostnet_quant/eval.py b/model_zoo/research/cv/ghostnet_quant/eval.py index c51af62099..f215f53922 100644 --- a/model_zoo/research/cv/ghostnet_quant/eval.py +++ b/model_zoo/research/cv/ghostnet_quant/eval.py @@ -47,7 +47,7 @@ if __name__ == '__main__': context.set_context(mode=context.GRAPH_MODE, device_target="GPU", save_graphs=False) else: - raise ValueError("Unsupport platform.") + raise ValueError("Unsupported platform.") loss = nn.SoftmaxCrossEntropyWithLogits(sparse=True, reduction='mean') diff --git a/model_zoo/research/cv/ghostnet_quant/src/dataset.py b/model_zoo/research/cv/ghostnet_quant/src/dataset.py index e5ec9f9710..edee462b4e 100644 --- a/model_zoo/research/cv/ghostnet_quant/src/dataset.py +++ b/model_zoo/research/cv/ghostnet_quant/src/dataset.py @@ -55,7 +55,7 @@ def create_dataset(dataset_path, do_train, config, platform, repeat_num=1, batch data_set = ds.MindDataset( dataset_path, num_parallel_workers=8, shuffle=True) else: - raise ValueError("Unsupport platform.") + raise ValueError("Unsupported platform.") resize_height = config.image_height buffer_size = 1000 diff --git a/model_zoo/research/cv/ghostnet_quant/src/launch.py b/model_zoo/research/cv/ghostnet_quant/src/launch.py index 003221310e..b81a33e82a 100644 --- a/model_zoo/research/cv/ghostnet_quant/src/launch.py +++ b/model_zoo/research/cv/ghostnet_quant/src/launch.py @@ -34,7 +34,7 @@ def parse_args(): >>> parse_args() """ parser = ArgumentParser(description="mindspore distributed training launch " - "helper utilty that will spawn up " + "helper utility that will spawn up " "multiple distributed processes") parser.add_argument("--nproc_per_node", type=int, default=1, help="The number of processes to launch on each node, " diff --git a/model_zoo/research/cv/resnet50_adv_pruning/eval.py b/model_zoo/research/cv/resnet50_adv_pruning/eval.py index fe9370e42d..c59860387b 100644 --- a/model_zoo/research/cv/resnet50_adv_pruning/eval.py +++ b/model_zoo/research/cv/resnet50_adv_pruning/eval.py @@ -49,7 +49,7 @@ if __name__ == '__main__': context.set_context(mode=context.GRAPH_MODE, device_target="GPU", save_graphs=False) else: - raise ValueError("Unsupport platform.") + raise ValueError("Unsupported platform.") loss = nn.SoftmaxCrossEntropyWithLogits(sparse=True, reduction='mean') diff --git a/model_zoo/research/cv/resnet50_adv_pruning/src/pet_dataset.py b/model_zoo/research/cv/resnet50_adv_pruning/src/pet_dataset.py index 6f506a6505..8eb9eaecc7 100644 --- a/model_zoo/research/cv/resnet50_adv_pruning/src/pet_dataset.py +++ b/model_zoo/research/cv/resnet50_adv_pruning/src/pet_dataset.py @@ -56,7 +56,7 @@ def create_dataset(dataset_path, do_train, config, platform, repeat_num=1, batch data_set = ds.MindDataset( dataset_path, num_parallel_workers=8, shuffle=False) else: - raise ValueError("Unsupport platform.") + raise ValueError("Unsupported platform.") resize_height = config.image_height buffer_size = 1000 diff --git a/model_zoo/research/cv/squeezenet/README.md b/model_zoo/research/cv/squeezenet/README.md index 1e396dd8a9..e4212db51a 100644 --- a/model_zoo/research/cv/squeezenet/README.md +++ b/model_zoo/research/cv/squeezenet/README.md @@ -74,7 +74,7 @@ For FP16 operators, if the input data type is FP32, the backend of MindSpore wil After installing MindSpore via the official website, you can start training and evaluation as follows: -- runing on Ascend +- running on Ascend ```bash # distributed training diff --git a/model_zoo/research/cv/ssd_ghostnet/README.md b/model_zoo/research/cv/ssd_ghostnet/README.md index 68fdc9678f..efbd22cf8c 100644 --- a/model_zoo/research/cv/ssd_ghostnet/README.md +++ b/model_zoo/research/cv/ssd_ghostnet/README.md @@ -59,7 +59,7 @@ Dataset used: [COCO2017]() ``` 2. If your own dataset is used. **Select dataset to other when run script.** - Organize the dataset infomation into a TXT file, each row in the file is as follows: + Organize the dataset information into a TXT file, each row in the file is as follows: ```python train2017/0000001.jpg 0,259,401,459,7 35,28,324,201,2 0,30,59,80,2 diff --git a/model_zoo/research/cv/ssd_ghostnet/scripts/run_distribute_train_ghostnet.sh b/model_zoo/research/cv/ssd_ghostnet/scripts/run_distribute_train_ghostnet.sh index 5d113c1ca8..8b6724049b 100644 --- a/model_zoo/research/cv/ssd_ghostnet/scripts/run_distribute_train_ghostnet.sh +++ b/model_zoo/research/cv/ssd_ghostnet/scripts/run_distribute_train_ghostnet.sh @@ -15,7 +15,7 @@ # ============================================================================ echo "==============================================================================================================" -echo "Please run the scipt as: " +echo "Please run the script as: " echo "sh run_distribute_train_ghostnet.sh DEVICE_NUM EPOCH_SIZE LR DATASET RANK_TABLE_FILE PRE_TRAINED PRE_TRAINED_EPOCH_SIZE" echo "for example: sh run_distribute_train_ghostnet.sh 8 500 0.2 coco /data/hccl.json /opt/ssd-300.ckpt(optional) 200(optional)" echo "It is better to use absolute path." @@ -33,7 +33,7 @@ BASE_PATH=$(cd "`dirname $0`" || exit; pwd) cd $BASE_PATH/../ || exit python train.py --only_create_dataset=True -echo "After running the scipt, the network runs in the background. The log will be generated in LOGx/log.txt" +echo "After running the script, the network runs in the background. The log will be generated in LOGx/log.txt" export RANK_SIZE=$1 EPOCH_SIZE=$2 diff --git a/model_zoo/research/cv/tinynet/src/dataset.py b/model_zoo/research/cv/tinynet/src/dataset.py index 3094e68947..e2225bdd51 100755 --- a/model_zoo/research/cv/tinynet/src/dataset.py +++ b/model_zoo/research/cv/tinynet/src/dataset.py @@ -50,7 +50,7 @@ def split_imgs_and_labels(imgs, labels, batchInfo): def create_dataset(batch_size, train_data_url='', workers=8, distributed=False, input_size=224, color_jitter=0.4): - """Creat ImageNet training dataset""" + """Create ImageNet training dataset""" if not os.path.exists(train_data_url): raise ValueError('Path not exists') decode_op = py_vision.Decode() @@ -102,7 +102,7 @@ def create_dataset(batch_size, train_data_url='', workers=8, distributed=False, def create_dataset_val(batch_size=128, val_data_url='', workers=8, distributed=False, input_size=224): - """Creat ImageNet validation dataset""" + """Create ImageNet validation dataset""" if not os.path.exists(val_data_url): raise ValueError('Path not exists') rank_id = get_rank() if distributed else 0 diff --git a/model_zoo/research/hpc/ocean_model/README.md b/model_zoo/research/hpc/ocean_model/README.md index 720b148b7b..5728d20507 100644 --- a/model_zoo/research/hpc/ocean_model/README.md +++ b/model_zoo/research/hpc/ocean_model/README.md @@ -15,7 +15,7 @@ ## Description -Generalized Operator Modelling of the Ocean (GOMO) is a three-dimensional ocean model based on OpenArray which is a simple operator library for the decoupling of ocean modelling and parallel computing (Xiaomeng Huang et al, 2019). GOMO is a numerical solution model using finite differential algorithm to solve PDE equations. With MindSpore and GPU, we can achieve great improvments in solving those PDE equations compared with CPU. +Generalized Operator Modelling of the Ocean (GOMO) is a three-dimensional ocean model based on OpenArray which is a simple operator library for the decoupling of ocean modelling and parallel computing (Xiaomeng Huang et al, 2019). GOMO is a numerical solution model using finite differential algorithm to solve PDE equations. With MindSpore and GPU, we can achieve great improvements in solving those PDE equations compared with CPU. This is an example of training GOMO Model with MindSpore on GPU. ## Model Architecture diff --git a/model_zoo/research/hpc/ocean_model/src/GOMO.py b/model_zoo/research/hpc/ocean_model/src/GOMO.py index 8ca6b85d80..1c8de38f69 100644 --- a/model_zoo/research/hpc/ocean_model/src/GOMO.py +++ b/model_zoo/research/hpc/ocean_model/src/GOMO.py @@ -668,7 +668,7 @@ class GOMO(nn.Cell): el: the surface elevation as used in the external mode (m). Returns: - tuple[Tensor], update varibles of external mode + tuple[Tensor], update variables of external mode """ adx2d = self.reduce_sum(advx * self.dz, 2) ady2d = self.reduce_sum(advy * self.dz, 2) @@ -836,7 +836,7 @@ class GOMO(nn.Cell): utf, vtf: ua, va time averaged over the interval, DT = dti(ms-1) Returns: - tuple[Tensor], update varibles of external mode + tuple[Tensor], update variables of external mode """ vamax = P.ReduceMax()(P.Abs()(vaf)) if iext == (self.isplit - 2): diff --git a/model_zoo/research/nlp/dscnn/README.md b/model_zoo/research/nlp/dscnn/README.md index b312c3e0fc..22cfa5347c 100644 --- a/model_zoo/research/nlp/dscnn/README.md +++ b/model_zoo/research/nlp/dscnn/README.md @@ -204,8 +204,8 @@ Parameters for both training and evaluation can be set in config.py. for shell script: ```python - # sh srcipts/run_train_ascend.sh [device_id] - sh srcipts/run_train_ascend.sh 0 + # sh scripts/run_train_ascend.sh [device_id] + sh scripts/run_train_ascend.sh 0 ``` for python script: diff --git a/model_zoo/research/rl/ldp_linucb/README.md b/model_zoo/research/rl/ldp_linucb/README.md index 09150201e5..9c37d2068e 100644 --- a/model_zoo/research/rl/ldp_linucb/README.md +++ b/model_zoo/research/rl/ldp_linucb/README.md @@ -21,7 +21,7 @@ Locally Differentially Private (LDP) LinUCB is a variant of LinUCB bandit algori # [Model Architecture](#contents) -The server interacts with users in rounds. For a coming user, the server first transfers the current model parameters to the user. In the user side, the model chooses an action based on the user feature to play (e.g., choose a movie to recommend), and observes a reward (or loss) value from the user (e.g., rating of the movie). Then we perturb the data to be transfered by adding Gaussian noise. Finally, the server receives the perturbed data and updates the model. Details can be found in the [original paper](https://arxiv.org/abs/2006.00701). +The server interacts with users in rounds. For a coming user, the server first transfers the current model parameters to the user. In the user side, the model chooses an action based on the user feature to play (e.g., choose a movie to recommend), and observes a reward (or loss) value from the user (e.g., rating of the movie). Then we perturb the data to be transferred by adding Gaussian noise. Finally, the server receives the perturbed data and updates the model. Details can be found in the [original paper](https://arxiv.org/abs/2006.00701). # [Dataset](#contents) @@ -54,7 +54,7 @@ Dataset used: [MovieLens 100K](https://grouplens.org/datasets/movielens/100k/) ├── ldp_linucb ├── README.md // descriptions about LDP LinUCB ├── scripts - │ ├── run_train_eval.sh // shell script for runing on Ascend + │ ├── run_train_eval.sh // shell script for running on Ascend ├── src │ ├── dataset.py // dataset for movielens │ ├── linucb.py // model @@ -124,7 +124,7 @@ The performance compared with optimal non-private regret O(sqrt(T)): # [Description of Random Situation](#contents) -In `train_eval.py`, we randomly sample a user at each round. We also add Gaussian noise to the date being transfered. +In `train_eval.py`, we randomly sample a user at each round. We also add Gaussian noise to the date being transferred. # [ModelZoo Homepage](#contents) diff --git a/model_zoo/utils/hccl_tools/hccl_tools.py b/model_zoo/utils/hccl_tools/hccl_tools.py index 1bd0ea2e94..b9bd1894a9 100644 --- a/model_zoo/utils/hccl_tools/hccl_tools.py +++ b/model_zoo/utils/hccl_tools/hccl_tools.py @@ -34,7 +34,7 @@ def parse_args(): >>> parse_args() """ parser = ArgumentParser(description="mindspore distributed training launch " - "helper utilty that will generate hccl" + "helper utility that will generate hccl" " config file") parser.add_argument("--device_num", type=str, default="[0,8)", help="The number of the Ascend accelerators used. please note that the Ascend accelerators"