From 22007f209e2c6b7189c4ef6c23cf433c0f93375f Mon Sep 17 00:00:00 2001 From: liuzx Date: Wed, 24 Jan 2024 09:19:36 +0800 Subject: [PATCH] update readme --- gcu_mnist_example/README.md | 5 ++--- gpgpu_mnist_example/README.md | 4 ++-- gpu_mnist_example/README.md | 9 ++++----- npu_mnist_example/README.md | 4 ++-- npu_mnist_example/train_multi_card.py | 7 +++++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/gcu_mnist_example/README.md b/gcu_mnist_example/README.md index 6812796..3c9cb80 100644 --- a/gcu_mnist_example/README.md +++ b/gcu_mnist_example/README.md @@ -1,4 +1,3 @@ - # 如何在启智平台上进行模型调试和训练—GCU_手写数字识别示例 ## 一 ,数据集及预训练模型准备 @@ -39,9 +38,9 @@ c2net_context = prepare() ##### 2,获取代码路径 ``` -code_path = c2net_context.code_path +"/" +"项目名" +code_path = c2net_context.code_path +"/" +"项目名".lower() 在本示例中代码路径为: -code_path = c2net_context.code_path + "/" + "Openl_Cloudbrain_Example" +code_path = c2net_context.code_path + "/" + "Openl_Cloudbrain_Example".lower() ``` ##### 3,获取数据集路径 diff --git a/gpgpu_mnist_example/README.md b/gpgpu_mnist_example/README.md index 271f8e1..5713e2f 100644 --- a/gpgpu_mnist_example/README.md +++ b/gpgpu_mnist_example/README.md @@ -38,9 +38,9 @@ c2net_context = prepare() ##### 2,获取代码路径 ``` -code_path = c2net_context.code_path +"/" +"项目名" +code_path = c2net_context.code_path +"/" + "项目名".lower() 在本示例中代码路径为: -code_path = c2net_context.code_path + "/" + "Openl_Cloudbrain_Example" +code_path = c2net_context.code_path + "/" + "Openl_Cloudbrain_Example".lower() ``` ##### 3,获取数据集路径 diff --git a/gpu_mnist_example/README.md b/gpu_mnist_example/README.md index cf1982e..579a3db 100644 --- a/gpu_mnist_example/README.md +++ b/gpu_mnist_example/README.md @@ -1,4 +1,3 @@ - # 如何在启智平台上进行模型调试和训练—GPU_手写数字识别示例 ## 一 ,数据集及预训练模型准备 @@ -12,9 +11,9 @@ > MnistDataset_torch.zip > - > ├── test + > ├── test > - > └── train + > └── train > ##### 2,预训练模型说明: @@ -39,9 +38,9 @@ c2net_context = prepare() ##### 2,获取代码路径 ``` -code_path = c2net_context.code_path +"/" +"项目名" +code_path = c2net_context.code_path +"/" +"项目名".lower() 在本示例中代码路径为: -code_path = c2net_context.code_path + "/" + "Openl_Cloudbrain_Example" +code_path = c2net_context.code_path + "/" + "Openl_Cloudbrain_Example".lower() ``` ##### 3,获取数据集路径 diff --git a/npu_mnist_example/README.md b/npu_mnist_example/README.md index 1ecb27f..439424f 100644 --- a/npu_mnist_example/README.md +++ b/npu_mnist_example/README.md @@ -40,9 +40,9 @@ c2net_context = prepare() ##### 2,获取代码路径 ``` -code_path = c2net_context.code_path +"/" +"项目名" +code_path = c2net_context.code_path +"/" + "项目名".lower() 在本示例中代码路径为: -code_path = c2net_context.code_path + "/" + "Openl_Cloudbrain_Example" +code_path = c2net_context.code_path + "/" + "Openl_Cloudbrain_Example".lower() ``` ##### 3,获取数据集路径 diff --git a/npu_mnist_example/train_multi_card.py b/npu_mnist_example/train_multi_card.py index ffa6491..2741550 100644 --- a/npu_mnist_example/train_multi_card.py +++ b/npu_mnist_example/train_multi_card.py @@ -50,10 +50,13 @@ parser.add_argument('--epoch_size', if __name__ == "__main__": ###请在代码中加入args, unknown = parser.parse_known_args(),可忽略掉--ckpt_url参数报错等参数问题 args, unknown = parser.parse_known_args() - + MnistDataset_mindspore_path = '' + Mindspore_MNIST_Example_Model_path = '' + output_path = '' + device_num = int(os.getenv('RANK_SIZE')) #使用多卡时 - # set device_id and init for multi-card training + # set device_id and init for multi-card training context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target, device_id=int(os.getenv('ASCEND_DEVICE_ID'))) context.reset_auto_parallel_context() context.set_auto_parallel_context(device_num = device_num, parallel_mode=ParallelMode.DATA_PARALLEL, gradients_mean=True, parameter_broadcast=True)