diff --git a/official/cv/alexnet/README.md b/official/cv/alexnet/README.md index 8e83818bfdcc0af7e348dd6feaeb6d42380303f1..4f5d225589424e50ea4c23c01a7dfdb0b45420ce 100644 --- a/official/cv/alexnet/README.md +++ b/official/cv/alexnet/README.md @@ -68,12 +68,12 @@ After installing MindSpore via the official website, you can start training and ```python # enter script dir, train AlexNet -bash run_standalone_train_ascend.sh [DATA_PATH] [CKPT_SAVE_PATH] -# example: bash run_standalone_train_ascend.sh /home/DataSet/Cifar10/cifar-10-batches-bin/ /home/model/alexnet/ckpt/ +bash run_standalone_train_ascend.sh [cifar10|imagenet] [DATA_PATH] [DEVICE_ID] [CKPT_PATH] +# example: bash run_standalone_train_ascend.sh cifar10 /home/DataSet/Cifar10/cifar-10-batches-bin/ 0 /home/model/alexnet/ckpt/ # enter script dir, evaluate AlexNet -bash run_standalone_eval_ascend.sh [DATA_PATH] [CKPT_NAME] -# example: bash run_standalone_eval_ascend.sh /home/DataSet/cifar10/cifar-10-verify-bin /home/model/cv/alxnet/ckpt/checkpoint_alexnet-1_1562.ckpt +bash run_standalone_eval_ascend.sh [cifar10|imagenet] [DATA_PATH] [CKPT_NAME] [DEVICE_ID] +# example: bash run_standalone_eval_ascend.sh cifar10 /home/DataSet/cifar10/cifar-10-verify-bin /home/model/cv/alxnet/ckpt/checkpoint_alexnet-1_1562.ckpt 0 ``` - Running on [ModelArts](https://support.huaweicloud.com/modelarts/) @@ -231,7 +231,7 @@ Major parameters in train.py and config.py as follows: ```bash python train.py --config_path default_config.yaml --data_path cifar-10-batches-bin --ckpt_path ckpt > log 2>&1 & # or enter script dir, and run the script - bash run_standalone_train_ascend.sh /home/DataSet/Cifar10/cifar-10-batches-bin/ /home/model/alexnet/ckpt/ + bash run_standalone_train_ascend.sh cifar10 /home/DataSet/Cifar10/cifar-10-batches-bin/ 0 /home/model/alexnet/ckpt/ ``` After training, the loss value will be achieved as follows: @@ -253,7 +253,7 @@ Major parameters in train.py and config.py as follows: ```bash python train.py --config_path default_config.yaml --device_target "GPU" --data_path cifar-10-batches-bin --ckpt_path ckpt > log 2>&1 & # or enter script dir, and run the script - bash run_standalone_train_for_gpu.sh cifar-10-batches-bin ckpt + bash run_standalone_train_gpu.sh cifar10 cifar-10-batches-bin ckpt ``` After training, the loss value will be achieved as follows: @@ -278,7 +278,7 @@ Before running the command below, please check the checkpoint path used for eval ```bash python eval.py --config_path default_config.yaml --data_path cifar-10-verify-bin --ckpt_path ckpt/checkpoint_alexnet-1_1562.ckpt > eval_log.txt 2>&1 & # or enter script dir, and run the script - bash run_standalone_eval_ascend.sh cifar-10-verify-bin ckpt/checkpoint_alexnet-1_1562.ckpt + bash run_standalone_eval_ascend.sh cifar10 cifar-10-verify-bin ckpt/checkpoint_alexnet-1_1562.ckpt 0 ``` You can view the results through the file "eval_log". The accuracy of the test dataset will be as follows: @@ -293,7 +293,7 @@ Before running the command below, please check the checkpoint path used for eval ```bash python eval.py --config_path default_config.yaml --device_target "GPU" --data_path cifar-10-verify-bin --ckpt_path ckpt/checkpoint_alexnet-30_1562.ckpt > eval_log 2>&1 & # or enter script dir, and run the script - bash run_standalone_eval_for_gpu.sh cifar-10-verify-bin ckpt/checkpoint_alexnet-30_1562.ckpt + bash run_standalone_eval_gpu.sh cifar10 cifar-10-verify-bin ckpt/checkpoint_alexnet-30_1562.ckpt 0 ``` You can view the results through the file "eval_log". The accuracy of the test dataset will be as follows: diff --git a/official/cv/alexnet/README_CN.md b/official/cv/alexnet/README_CN.md index 17873e1a24839303151beaaa3e676a9f83e5569b..aff8516744a6c1850a3aa330aec4df0152a60685 100644 --- a/official/cv/alexnet/README_CN.md +++ b/official/cv/alexnet/README_CN.md @@ -70,14 +70,14 @@ AlexNet鐢�5涓嵎绉眰鍜�3涓叏杩炴帴灞傜粍鎴愩€傚涓嵎绉牳鐢ㄤ簬鎻愬彇 ```python # 杩涘叆鑴氭湰鐩綍锛岃缁傾lexNet -bash run_standalone_train_ascend.sh [DATA_PATH] [CKPT_SAVE_PATH] -# example: bash run_standalone_train_ascend.sh /home/DataSet/Cifar10/cifar-10-batches-bin/ /home/model/alexnet/ckpt/ +bash run_standalone_train_ascend.sh [cifar10|imagenet] [DATA_PATH] [DEVICE_ID] [CKPT_PATH] +# example: bash run_standalone_train_ascend.sh cifar10 /home/DataSet/Cifar10/cifar-10-batches-bin/ 0 /home/model/alexnet/ckpt/ # 鍒嗗竷寮忚缁傾lexNet # 杩涘叆鑴氭湰鐩綍锛岃瘎浼癆lexNet -bash run_standalone_eval_ascend.sh [DATA_PATH] [CKPT_NAME] -# example: bash run_standalone_eval_ascend.sh /home/DataSet/cifar10/cifar-10-verify-bin /home/model/cv/alxnet/ckpt/checkpoint_alexnet-1_1562.ckpt +bash run_standalone_eval_ascend.sh [cifar10|imagenet] [DATA_PATH] [CKPT_NAME] [DEVICE_ID] +# example: bash run_standalone_eval_ascend.sh cifar10 /home/DataSet/cifar10/cifar-10-verify-bin /home/model/cv/alxnet/ckpt/checkpoint_alexnet-1_1562.ckpt 0 ``` - 鍦� ModelArts 杩涜璁粌 (濡傛灉浣犳兂鍦╩odelarts涓婅繍琛岋紝鍙互鍙傝€冧互涓嬫枃妗� [modelarts](https://support.huaweicloud.com/modelarts/)) @@ -221,7 +221,7 @@ train.py鍜宑onfig.py涓富瑕佸弬鏁板涓嬶細 ```bash python train.py --config_path default_config.yaml --data_path cifar-10-batches-bin --ckpt_path ckpt > log 2>&1 & # 鎴栬繘鍏ヨ剼鏈洰褰曪紝鎵ц鑴氭湰 - bash run_standalone_train_ascend.sh /home/DataSet/Cifar10/cifar-10-batches-bin/ /home/model/alexnet/ckpt/ + bash run_standalone_train_ascend.sh cifar10 /home/DataSet/Cifar10/cifar-10-batches-bin/ 0 /home/model/alexnet/ckpt/ ``` 缁忚繃璁粌鍚庯紝鎹熷け鍊煎涓嬶細 @@ -243,7 +243,7 @@ train.py鍜宑onfig.py涓富瑕佸弬鏁板涓嬶細 ```bash python train.py --config_path default_config.yaml --device_target "GPU" --data_path cifar-10-batches-bin --ckpt_path ckpt > log 2>&1 & # 鎴栬繘鍏ヨ剼鏈洰褰曪紝鎵ц鑴氭湰 - bash run_standalone_train_for_gpu.sh cifar-10-batches-bin ckpt + bash run_standalone_train_gpu.sh cifar10 cifar-10-batches-bin ckpt ``` 缁忚繃璁粌鍚庯紝鎹熷け鍊煎涓嬶細 @@ -268,7 +268,7 @@ train.py鍜宑onfig.py涓富瑕佸弬鏁板涓嬶細 ```bash python eval.py --config_path default_config.yaml --data_path cifar-10-verify-bin --ckpt_path ckpt/checkpoint_alexnet-1_1562.ckpt > eval_log.txt 2>&1 & #鎴栬繘鍏ヨ剼鏈洰褰曪紝鎵ц鑴氭湰 - bash run_standalone_eval_ascend.sh /home/DataSet/cifar10/cifar-10-verify-bin /home/model/cv/alxnet/ckpt/checkpoint_alexnet-1_1562.ckpt + bash run_standalone_eval_ascend.sh cifar10 cifar-10-verify-bin ckpt/checkpoint_alexnet-1_1562.ckpt 0 ``` 鍙€氳繃"eval_log鈥濇枃浠舵煡鐪嬬粨鏋溿€傛祴璇曟暟鎹泦鐨勫噯纭巼濡備笅锛� @@ -283,7 +283,7 @@ train.py鍜宑onfig.py涓富瑕佸弬鏁板涓嬶細 ```bash python eval.py --config_path default_config.yaml --device_target "GPU" --data_path cifar-10-verify-bin --ckpt_path ckpt/checkpoint_alexnet-30_1562.ckpt > eval_log 2>&1 & #鎴栬繘鍏ヨ剼鏈洰褰曪紝鎵ц鑴氭湰 - bash run_standalone_eval_for_gpu.sh cifar-10-verify-bin ckpt/checkpoint_alexnet-30_1562.ckpt + bash run_standalone_eval_gpu.sh cifar10 cifar-10-verify-bin ckpt/checkpoint_alexnet-30_1562.ckpt 0 ``` 鍙€氳繃"eval_log鈥濇枃浠舵煡鐪嬬粨鏋溿€傛祴璇曟暟鎹泦鐨勫噯纭巼濡備笅锛� diff --git a/official/cv/resnet/README.md b/official/cv/resnet/README.md index 4d486f93b416f5b1d6f78da2afeb0348024f7afa..20e0e9371859afefa9979c215a2e138c58ac6b71 100644 --- a/official/cv/resnet/README.md +++ b/official/cv/resnet/README.md @@ -167,27 +167,27 @@ If you want to run in modelarts, please check the official documentation of [mod ```python # run distributed training on modelarts example -# (1) First, Perform a or b. +# (1) Add "config_path='/path_to_code/config/resnet50_imagenet2021_config.yaml'" on the website UI interface. +# (2) First, Perform a or b. # a. Set "enable_modelarts=True" on yaml file. # Set other parameters on yaml file you need. # b. Add "enable_modelarts=True" on the website UI interface. # Add other parameters on the website UI interface. -# (2) Set the config directory to "config_path=/The path of config in S3/" # (3) Set the code directory to "/path/resnet" on the website UI interface. # (4) Set the startup file to "train.py" on the website UI interface. # (5) Set the "Dataset path" and "Output file path" and "Job log path" to your path on the website UI interface. # (6) Create your job. # run evaluation on modelarts example -# (1) Copy or upload your trained model to S3 bucket. -# (2) Perform a or b. +# (1) Add "config_path='/path_to_code/config/resnet50_imagenet2021_config.yaml'" on the website UI interface. +# (2) Copy or upload your trained model to S3 bucket. +# (3) Perform a or b. # a. Set "enable_modelarts=True" on yaml file. # Set "checkpoint_file_path='/cache/checkpoint_path/model.ckpt'" on yaml file. # Set "checkpoint_url=/The path of checkpoint in S3/" on yaml file. # b. Add "enable_modelarts=True" on the website UI interface. # Add "checkpoint_file_path='/cache/checkpoint_path/model.ckpt'" on the website UI interface. # Add "checkpoint_url=/The path of checkpoint in S3/" on the website UI interface. -# (3) Set the config directory to "config_path=/The path of config in S3/" # (4) Set the code directory to "/path/resnet" on the website UI interface. # (5) Set the startup file to "eval.py" on the website UI interface. # (6) Set the "Dataset path" and "Output file path" and "Job log path" to your path on the website UI interface. @@ -702,7 +702,9 @@ Export on ModelArts (If you want to run in modelarts, please check the official ```python # Export on ModelArts -# (1) Perform a or b. +# (1) Add "config_path='/path_to_code/config/resnet50_imagenet2021_config.yaml'" on the website UI interface. +# (2) Upload or copy your trained model to S3 bucket. +# (3) Perform a or b. # a. Set "enable_modelarts=True" on default_config.yaml file. # Set "checkpoint_file_path='/cache/checkpoint_path/model.ckpt'" on default_config.yaml file. # Set "checkpoint_url='s3://dir_to_trained_ckpt/'" on default_config.yaml file. @@ -715,11 +717,10 @@ Export on ModelArts (If you want to run in modelarts, please check the official # Add "file_name='./resnet'" on the website UI interface. # Add "file_format='AIR'" on the website UI interface. # Add other parameters on the website UI interface. -# (2) Set the config_path="/path/yaml file" on the website UI interface. -# (3) Set the code directory to "/path/resnet" on the website UI interface. -# (4) Set the startup file to "export.py" on the website UI interface. -# (5) Set the "Output file path" and "Job log path" to your path on the website UI interface. -# (6) Create your job. +# (4) Set the code directory to "/path/resnet" on the website UI interface. +# (5) Set the startup file to "export.py" on the website UI interface. +# (6) Set the "Output file path" and "Job log path" to your path on the website UI interface. +# (7) Create your job. ``` ### Infer on Ascend310 diff --git a/official/cv/resnet/README_CN.md b/official/cv/resnet/README_CN.md index ab8b9f6cb3bed9005073b236b9217aafa63fab83..59b68742dab50f95ad6a26c31ecd8584558988e2 100644 --- a/official/cv/resnet/README_CN.md +++ b/official/cv/resnet/README_CN.md @@ -151,12 +151,12 @@ bash run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH] [CONFIG_PATH] ```python # 鍦╩odelarts涓婁娇鐢ㄥ垎甯冨紡璁粌鐨勭ず渚嬶細 -# (1) 閫夊潃a鎴栬€卋鍏朵腑涓€绉嶆柟寮忋€� +# (1) 鍦ㄧ綉椤典笂璁剧疆 "config_path='/path_to_code/config/resnet50_imagenet2021_config.yaml'" +# (2) 閫夊潃a鎴栬€卋鍏朵腑涓€绉嶆柟寮忋€� # a. 璁剧疆 "enable_modelarts=True" 銆� # 鍦▂aml鏂囦欢涓婅缃綉缁滄墍闇€鐨勫弬鏁般€� # b. 澧炲姞 "enable_modelarts=True" 鍙傛暟鍦╩odearts鐨勭晫闈笂銆� # 鍦╩odelarts鐨勭晫闈笂璁剧疆缃戠粶鎵€闇€鐨勫弬鏁般€� -# (2) 鍦╩odelarts鐨勭晫闈笂璁剧疆閰嶇疆鏂囦欢鐨勮矾寰�"config_path=/The path of config in S3/" # (3) 鍦╩odelarts鐨勭晫闈笂璁剧疆浠g爜鐨勮矾寰� "/path/resnet"銆� # (4) 鍦╩odelarts鐨勭晫闈笂璁剧疆妯″瀷鐨勫惎鍔ㄦ枃浠� "train.py" 銆� # (5) 鍦╩odelarts鐨勭晫闈笂璁剧疆妯″瀷鐨勬暟鎹矾寰� "Dataset path" , @@ -164,20 +164,20 @@ bash run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH] [CONFIG_PATH] # (6) 寮€濮嬫ā鍨嬬殑璁粌銆� # 鍦╩odelarts涓婁娇鐢ㄦā鍨嬫帹鐞嗙殑绀轰緥 -# (1) 鎶婅缁冨ソ鐨勬ā鍨嬪湴鏂瑰埌妗剁殑瀵瑰簲浣嶇疆銆� -# (2) 閫夊潃a鎴栬€卋鍏朵腑涓€绉嶆柟寮忋€� +# (1) 鍦ㄧ綉椤典笂璁剧疆 "config_path='/path_to_code/config/resnet50_imagenet2021_config.yaml'" +# (2) 鎶婅缁冨ソ鐨勬ā鍨嬪湴鏂瑰埌妗剁殑瀵瑰簲浣嶇疆銆� +# (3) 閫夊潃a鎴栬€卋鍏朵腑涓€绉嶆柟寮忋€� # a. 璁剧疆 "enable_modelarts=True" # 璁剧疆 "checkpoint_file_path='/cache/checkpoint_path/model.ckpt" 鍦� yaml 鏂囦欢. # 璁剧疆 "checkpoint_url=/The path of checkpoint in S3/" 鍦� yaml 鏂囦欢. # b. 澧炲姞 "enable_modelarts=True" 鍙傛暟鍦╩odearts鐨勭晫闈笂銆� # 澧炲姞 "checkpoint_file_path='/cache/checkpoint_path/model.ckpt'" 鍙傛暟鍦╩odearts鐨勭晫闈笂銆� # 澧炲姞 "checkpoint_url=/The path of checkpoint in S3/" 鍙傛暟鍦╩odearts鐨勭晫闈笂銆� -# (2) 鍦╩odelarts鐨勭晫闈笂璁剧疆閰嶇疆鏂囦欢鐨勮矾寰�"config_path=/The path of config in S3/" -# (3) 鍦╩odelarts鐨勭晫闈笂璁剧疆浠g爜鐨勮矾寰� "/path/resnet"銆� -# (4) 鍦╩odelarts鐨勭晫闈笂璁剧疆妯″瀷鐨勫惎鍔ㄦ枃浠� "eval.py" 銆� -# (5) 鍦╩odelarts鐨勭晫闈笂璁剧疆妯″瀷鐨勬暟鎹矾寰� "Dataset path" , +# (4) 鍦╩odelarts鐨勭晫闈笂璁剧疆浠g爜鐨勮矾寰� "/path/resnet"銆� +# (5) 鍦╩odelarts鐨勭晫闈笂璁剧疆妯″瀷鐨勫惎鍔ㄦ枃浠� "eval.py" 銆� +# (6) 鍦╩odelarts鐨勭晫闈笂璁剧疆妯″瀷鐨勬暟鎹矾寰� "Dataset path" , # 妯″瀷鐨勮緭鍑鸿矾寰�"Output file path" 鍜屾ā鍨嬬殑鏃ュ織璺緞 "Job log path" 銆� -# (6) 寮€濮嬫ā鍨嬬殑鎺ㄧ悊銆� +# (7) 寮€濮嬫ā鍨嬬殑鎺ㄧ悊銆� ``` # 鑴氭湰璇存槑 @@ -667,8 +667,9 @@ python export.py --checkpoint_file_path [CKPT_PATH] --file_name [FILE_NAME] --fi ModelArts瀵煎嚭mindir ```python -# (1) 鎶婅缁冨ソ鐨勬ā鍨嬪湴鏂瑰埌妗剁殑瀵瑰簲浣嶇疆銆� -# (2) 閫夊潃a鎴栬€卋鍏朵腑涓€绉嶆柟寮忋€� +# (1) 鍦ㄧ綉椤典笂璁剧疆 "config_path='/path_to_code/config/resnet50_imagenet2021_config.yaml'" +# (2) 鎶婅缁冨ソ鐨勬ā鍨嬪湴鏂瑰埌妗剁殑瀵瑰簲浣嶇疆銆� +# (3) 閫夊潃a鎴栬€卋鍏朵腑涓€绉嶆柟寮忋€� # a. 璁剧疆 "enable_modelarts=True" # 璁剧疆 "checkpoint_file_path='/cache/checkpoint_path/model.ckpt" 鍦� yaml 鏂囦欢銆� # 璁剧疆 "checkpoint_url=/The path of checkpoint in S3/" 鍦� yaml 鏂囦欢銆� @@ -679,7 +680,6 @@ ModelArts瀵煎嚭mindir # 澧炲姞 "checkpoint_url=/The path of checkpoint in S3/" 鍙傛暟鍦╩odearts鐨勭晫闈笂銆� # 璁剧疆 "file_name='./resnet'"鍙傛暟鍦╩odearts鐨勭晫闈笂銆� # 璁剧疆 "file_format='AIR'" 鍙傛暟鍦╩odearts鐨勭晫闈笂銆� -# (3) 璁剧疆缃戠粶閰嶇疆鏂囦欢鐨勮矾寰� "config_path=/The path of config in S3/" # (4) 鍦╩odelarts鐨勭晫闈笂璁剧疆浠g爜鐨勮矾寰� "/path/resnet"銆� # (5) 鍦╩odelarts鐨勭晫闈笂璁剧疆妯″瀷鐨勫惎鍔ㄦ枃浠� "export.py" 銆� # 妯″瀷鐨勮緭鍑鸿矾寰�"Output file path" 鍜屾ā鍨嬬殑鏃ュ織璺緞 "Job log path" 銆�