diff --git a/cplusplus/level1_single_api/1_acl/4_blas/gemm/README.md b/cplusplus/level1_single_api/1_acl/4_blas/gemm/README.md index 19635647e5bd93af1b8f1e5c6fe5ce02f25a0ffb..30ec454517183aa3b442cdcd8c38057e330a0369 100644 --- a/cplusplus/level1_single_api/1_acl/4_blas/gemm/README.md +++ b/cplusplus/level1_single_api/1_acl/4_blas/gemm/README.md @@ -75,14 +75,15 @@ The sample directory is organized as follows: Build the operator description information \(.json file\) of the matrix-matrix multiplication operator into an offline model \(.om file\) that adapts to the Ascend AI Processor. - Run the following command in the **acl\_execute\_gemm** directory (take Ascend310 as an example): + Switch to **acl\_execute\_gemm** example directory and execute the atc command. The command example is as follows. Plaease adjust the parameter values according to the parameter description before executing the command. + ``` - atc --singleop=run/out/test_data/config/gemm.json --soc_version=Ascend310 --output=run/out/op_models + atc --singleop=run/out/test_data/config/gemm.json --soc_version= --output=run/out/op_models ``` - **--singleop**: directory of the single-operator definition file \(.json\) - - **--soc\_version**: Version of the Ascend AI processor. Go to the CANN software installation directory/compiler/data/platform_config directory. The name of the .ini file is the version of the Ascend AI processor. Select the version as required. + - **--soc\_version**: Version of the Ascend AI processor. Modify the as required. If the cannot be determined, please run the **npu-smi info** command on the server where the Ascend AI Processor is installed to obtain the Chip Name information. The actual value is Ascend+Name. For example, if Chip Name is xxxyy, the actual value is Ascendxxxyy. - **--output**: directory for storing the generated .om file, that is, the **run/out/op\_models** directory. diff --git a/cplusplus/level1_single_api/1_acl/4_blas/gemm/README_CN.md b/cplusplus/level1_single_api/1_acl/4_blas/gemm/README_CN.md index 48cacb39fa3c2e0198dea8621d8e3c65a880bc25..9138aa484c99596577776c954958a423f005da8e 100644 --- a/cplusplus/level1_single_api/1_acl/4_blas/gemm/README_CN.md +++ b/cplusplus/level1_single_api/1_acl/4_blas/gemm/README_CN.md @@ -72,16 +72,16 @@ 将矩阵乘算子的算子描述信息(\*.json文件)编译成适配昇腾AI处理器的离线模型(\*.om文件),运行矩阵乘算子时使用。 - 切换到样例目录,执行如下命令(以昇腾310 AI处理器为例): + 切换到样例目录,执行atc命令,命令示例如下,请根据参数说明调整参数值后,再执行命令: ``` - atc --singleop=run/out/test_data/config/gemm.json --soc_version=Ascend310 --output=run/out/op_models + atc --singleop=run/out/test_data/config/gemm.json --soc_version= --output=run/out/op_models ``` - - --singleop:单算子定义文件(\*.json文件)。 - - --soc\_version:昇腾AI处理器的版本。进入“CANN软件安装目录/compiler/data/platform_config”目录,".ini"文件的文件名即为昇腾AI处理器的版本,请根据实际情况选择。 - - - --output:生成的om文件必须放在“run/out/op\_models“目录下。 + - --singleop:单算子定义文件(\*.json文件)所在的路径。直接使用命令示例中的路径,无需修改。 + - --soc\_version:昇腾AI处理器的版本。需根据实际情况修改。 + 若无法确定当前设备的soc_version,可在安装昇腾AI处理器的服务器上执行npu-smi info命令进行查询,获取Name信息,实际配置值为AscendName,例如Name取值为xxxyy,实际配置值为Ascendxxxyy。 + - --output:生成的om文件必须放在“run/out/op\_models“目录下。直接使用命令示例中的路径,无需修改 ## 编译运行 diff --git a/cplusplus/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/README.md b/cplusplus/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/README.md index da065f3e80d39e612caef49c1be91a6419dc8ea1..1afc839305f010a3f5749e421bd2a0e6ca1590f1 100644 --- a/cplusplus/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/README.md +++ b/cplusplus/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/README.md @@ -80,16 +80,16 @@ The sample directory is organized as follows: 2. Convert the ResNet-50 network into an offline model \(.om file\) that adapts to Ascend AI Processors. - Go to the sample directory and run the following command (take Ascend310 as an example): + Go to the example directory and execute the atc command. The command example is as follows. Plaease adjust the parameter values according to the parameter description before executing the command. ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50 --soc_version=Ascend310 --input_format=NCHW --input_fp16_nodes=data -output_type=FP32 --out_nodes=prob:0 + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50 --soc_version= --input_format=NCHW --input_fp16_nodes=data -output_type=FP32 --out_nodes=prob:0 ``` - **--model**: directory of the source model file. - **--weight**: directory of the weight file. - **--framework**: source framework type, selected from **0** \(Caffe\), **1** \(MindSpore\), **3** \(TensorFlow\), and **5** \(ONNX\). - - **--soc\_version**: Version of the Ascend AI processor. Go to the CANN software installation directory/compiler/data/platform_config directory. The name of the .ini file is the version of the Ascend AI processor. Select the version as required. + - **--soc\_version**: Version of the Ascend AI processor. Modify the as required. If the cannot be determined, please run the **npu-smi info** command on the server where the Ascend AI Processor is installed to obtain the Chip Name information. The actual value is Ascend+Name. For example, if Chip Name is xxxyy, the actual value is Ascendxxxyy. - **--input\_format**: input format. - **--input\_fp16\_nodes**: input nodes to specify as FP16 nodes. - **--output\_type** and **--out\_nodes**: specify the data type of the first output as float32. diff --git a/cplusplus/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/README_CN.md b/cplusplus/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/README_CN.md index 9b5b6e731783ef30bf8538563d9f59585e0f19ff..7aa833001c7ac682c8857542a4809561c0802310 100644 --- a/cplusplus/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/README_CN.md +++ b/cplusplus/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/README_CN.md @@ -82,21 +82,20 @@ 2. 将ResNet-50网络转换为适配昇腾AI处理器的离线模型(\*.om文件)。 - 切换到样例目录,执行如下命令(以昇腾310 AI处理器为例): + 切换到样例目录,执行atc命令,命令示例如下,请根据参数说明调整参数值后,再执行命令: ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50 --soc_version=Ascend310 --input_format=NCHW --input_fp16_nodes=data -output_type=FP32 --out_nodes=prob:0 + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50 --soc_version= --input_format=NCHW --input_fp16_nodes=data -output_type=FP32 --out_nodes=prob:0 ``` - - --model:原始模型文件路径。 - - --weight:权重文件路径。 - - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。 - - --soc\_version:昇腾AI处理器的版本。进入“CANN软件安装目录/compiler/data/platform_config”目录,".ini"文件的文件名即为昇腾AI处理器的版本,请根据实际情况选择。 - - - --input\_format:模型输入数据的Format。 - - --input\_fp16\_nodes:指定输入数据类型为FP16的输入节点名称。 - - --output\_type和--out\_nodes:这2个参数配合使用,指定prob节点的第一个输出的数据类型为float32。 - - --output:生成的resnet50.om文件存放在“样例目录/model“目录下。建议使用命令中的默认设置,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 + - --model:原始模型文件路径。直接使用命令示例中的路径,无需修改。 + - --weight:权重文件路径。直接使用命令示例中的路径,无需修改。 + - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。直接使用命令示例中的参数值,无需修改。 + - --soc\_version:昇腾AI处理器的版本。需根据实际情况修改。若无法确定当前设备的soc_version,可在安装昇腾AI处理器的服务器上执行npu-smi info命令进行查询,获取Name信息,实际配置值为AscendName,例如Name取值为xxxyy,实际配置值为Ascendxxxyy。 + - --input\_format:模型输入数据的Format。直接使用命令示例中的参数值,无需修改。 + - --input\_fp16\_nodes:指定输入数据类型为FP16的输入节点名称。直接使用命令示例中的参数值,无需修改。 + - --output\_type和--out\_nodes:这2个参数配合使用,指定prob节点的第一个输出的数据类型为float32。直接使用命令示例中的参数值,无需修改。 + - --output:生成的resnet50.om文件存放在“样例目录/model“目录下。建议使用命令示例中的参数值,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 ``` const char* omModelPath = "../model/resnet50.om"; diff --git a/cplusplus/level2_simple_inference/1_classification/resnet50_firstapp/README.md b/cplusplus/level2_simple_inference/1_classification/resnet50_firstapp/README.md index a98268db9f2122be9ef8ea1ab297a228e398fe3d..e63c1a3e21394fb75a07ead57451212c86bad43f 100644 --- a/cplusplus/level2_simple_inference/1_classification/resnet50_firstapp/README.md +++ b/cplusplus/level2_simple_inference/1_classification/resnet50_firstapp/README.md @@ -85,7 +85,7 @@ resnet50_firstapp 2. 执行模型转换。 - 执行以下命令(以昇腾310 AI处理器为例),将原始模型转换为昇腾AI处理器能识别的\*.om模型文件。请注意,执行命令的用户需具有命令中相关路径的可读、可写权限。以下命令中的“******”请根据实际样例包的存放目录替换、“******”请根据实际昇腾AI处理器版本替换。 + 执行以下命令(以昇腾310 AI处理器为例),将原始模型转换为昇腾AI处理器能识别的\*.om模型文件。请注意,执行命令的用户需具有命令中相关路径的可读、可写权限。以下命令中的“******”请根据实际样例包的存放目录替换。 ``` cd /cplusplus/level2_simple_inference/1_classification/resnet50_firstapp/model @@ -96,7 +96,7 @@ resnet50_firstapp - --model:ResNet-50网络的模型文件路径。 - --framework:原始框架类型。5表示ONNX。 - --output:resnet50.om模型文件的路径。若此处修改模型文件名及存储路径,则需要同步修改src/main.cpp中模型加载处的模型文件名及存储路径,即modelPath变量值,修改代码后需要重新编译。 - - --soc\_version:昇腾AI处理器的版本。 + - --soc\_version:昇腾AI处理器的版本。需根据实际情况修改。若无法确定当前设备的soc_version,可在安装昇腾AI处理器的服务器上执行npu-smi info命令进行查询,获取Name信息,实际配置值为AscendName,例如Name取值为xxxyy,实际配置值为Ascendxxxyy。 关于各参数的详细解释,请参见[《ATC工具使用指南》](https://www.hiascend.com/document/redirect/CannCommunityAtc)。 diff --git a/cplusplus/level2_simple_inference/1_classification/resnet50_imagenet_classification/README.md b/cplusplus/level2_simple_inference/1_classification/resnet50_imagenet_classification/README.md index fb8b77c79623c84a9cad2973c71e273411e551d2..968f6986e529ff4bc76c3a1ae7449a0589e8426d 100644 --- a/cplusplus/level2_simple_inference/1_classification/resnet50_imagenet_classification/README.md +++ b/cplusplus/level2_simple_inference/1_classification/resnet50_imagenet_classification/README.md @@ -75,16 +75,17 @@ The sample directory is organized as follows: 2. Convert the ResNet-50 network to an .om offline model adapted to Ascend AI ProcessorHiSilicon SoC. - Go to the sample directory and run the following command (take Ascend310 as an example): + Go to the example directory and execute the atc command. The command example is as follows. Plaease adjust the parameter values according to the parameter description before executing the command. + ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50 --soc_version=Ascend310 --input_format=NCHW --input_fp16_nodes=data -output_type=FP32 --out_nodes=prob:0 + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50 --soc_version= --input_format=NCHW --input_fp16_nodes=data -output_type=FP32 --out_nodes=prob:0 ``` - **--model**: directory of the source model file. - **--weight**: directory of the weight file. - **--framework**: source framework type, selected from **0** \(Caffe\), **1** \(MindSpore\), **3** \(TensorFlow\), and **5** \(ONNX\). - - **--soc\_version**: Version of the Ascend AI processor. Go to the CANN software installation directory/compiler/data/platform_config directory. The name of the .ini file is the version of the Ascend AI processor. Select the version as required. + - **--soc\_version**: Version of the Ascend AI processor. Modify the as required. If the cannot be determined, please run the **npu-smi info** command on the server where the Ascend AI Processor is installed to obtain the Chip Name information. The actual value is Ascend+Name. For example, if Chip Name is xxxyy, the actual value is Ascendxxxyy. - **--input\_format**: input format. - **--input\_fp16\_nodes**: input nodes to specify as FP16 nodes. - **--output\_type** and **--out\_nodes**: specify the data type of the first output as float32. diff --git a/cplusplus/level2_simple_inference/1_classification/resnet50_imagenet_classification/README_CN.md b/cplusplus/level2_simple_inference/1_classification/resnet50_imagenet_classification/README_CN.md index 2e7a615de08a854f3720b57836885b8d37ce7132..cd668e87fdeb3bc82e3cd3ff63c1b1c98c2e075d 100644 --- a/cplusplus/level2_simple_inference/1_classification/resnet50_imagenet_classification/README_CN.md +++ b/cplusplus/level2_simple_inference/1_classification/resnet50_imagenet_classification/README_CN.md @@ -78,21 +78,20 @@ 2. 将ResNet-50原始模型转换为适配昇腾AI处理器的离线模型(\*.om文件)。 - 切换到样例目录,执行如下命令(以昇腾310 AI处理器为例): + 切换到样例目录,执行atc命令,命令示例如下,请根据参数说明调整参数值后,再执行命令: ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50 --soc_version=Ascend310 --input_format=NCHW --input_fp16_nodes=data --output_type=FP32 --out_nodes=prob:0 + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50 --soc_version= --input_format=NCHW --input_fp16_nodes=data --output_type=FP32 --out_nodes=prob:0 ``` - - --model:原始模型文件路径。 - - --weight:权重文件路径。 - - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。 - - --soc\_version:昇腾AI处理器的版本。进入“CANN软件安装目录/compiler/data/platform_config”目录,".ini"文件的文件名即为昇腾AI处理器的版本,请根据实际情况选择。 - - - --input\_format:输入数据的Format。 - - --input\_fp16\_nodes:指定输入数据类型为FP16的输入节点名称。 - - --output\_type和--out\_nodes:这2个参数配合使用,指定prob节点的第一个输出的数据类型为float32。 - - --output:生成的resnet50.om文件存放在“样例目录/model“目录下。建议使用命令中的默认设置,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 + - --model:原始模型文件路径。直接使用命令示例中的路径,无需修改。 + - --weight:权重文件路径。直接使用命令示例中的路径,无需修改。 + - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。直接使用命令示例中的参数值,无需修改。 + - --soc\_version:昇腾AI处理器的版本。需根据实际情况修改。若无法确定当前设备的soc_version,可在安装昇腾AI处理器的服务器上执行npu-smi info命令进行查询,获取Name信息,实际配置值为AscendName,例如Name取值为xxxyy,实际配置值为Ascendxxxyy。 + - --input\_format:输入数据的Format。直接使用命令示例中的参数值,无需修改。 + - --input\_fp16\_nodes:指定输入数据类型为FP16的输入节点名称。直接使用命令示例中的参数值,无需修改。 + - --output\_type和--out\_nodes:这2个参数配合使用,指定prob节点的第一个输出的数据类型为float32。直接使用命令示例中的参数值,无需修改。 + - --output:生成的resnet50.om文件存放在“样例目录/model“目录下。建议使用命令示例中的路径,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 ``` const char* omModelPath = "../model/resnet50.om"; diff --git a/cplusplus/level2_simple_inference/1_classification/vdec_resnet50_classification/README.md b/cplusplus/level2_simple_inference/1_classification/vdec_resnet50_classification/README.md index 677245a68e58009a0418edcc73ca0e9c788f410e..add09705c6d5660ac2e92a1a3f0d6f374ef292c8 100644 --- a/cplusplus/level2_simple_inference/1_classification/vdec_resnet50_classification/README.md +++ b/cplusplus/level2_simple_inference/1_classification/vdec_resnet50_classification/README.md @@ -76,16 +76,16 @@ The sample directory is organized as follows: 2. Convert the ResNet-50 network into an offline model \(.om file\) that adapts to Ascend AI Processors. During model conversion, you need to set CSC parameters to convert YUV420SP images to RGB images. - Go to the sample directory and run the following command (take Ascend310 as an example): + Go to the example directory and execute the atc command. The command example is as follows. Plaease adjust the parameter values according to the parameter description before executing the command. ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version=Ascend310 --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version= --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp ``` - **--model**: directory of the source model file. - **--weight**: directory of the weight file. - **--framework**: source framework type, selected from **0** \(Caffe\), **1** \(MindSpore\), **3** \(TensorFlow\), and **5** \(ONNX\). - - **--soc\_version**: Version of the Ascend AI processor. Go to the CANN software installation directory/compiler/data/platform_config directory. The name of the .ini file is the version of the Ascend AI processor. Select the version as required. + - **--soc\_version**: Version of the Ascend AI processor. Modify the as required. If the cannot be determined, please run the **npu-smi info** command on the server where the Ascend AI Processor is installed to obtain the Chip Name information. The actual value is Ascend+Name. For example, if Chip Name is xxxyy, the actual value is Ascendxxxyy. - **--insert\_op\_conf**: path of the configuration file for inserting the AI Pre-Processing \(AIPP\) operator for AI Core–based image preprocessing including image resizing, CSC, and mean subtraction and factor multiplication \(for pixel changing\), prior to model inference. - **--output**: directory for storing the generated **resnet50\_aipp.om** file, that is, **/model** under the sample directory. The default path in the command example is recommended. To specify another path, you need to change the value of **omModelPath** in **sample\_process.cpp** before building the code. diff --git a/cplusplus/level2_simple_inference/1_classification/vdec_resnet50_classification/README_CN.md b/cplusplus/level2_simple_inference/1_classification/vdec_resnet50_classification/README_CN.md index 3514b5c4fcd20daff0dede9eab34e6a13948ba8f..63f620acb8f133a361dd08d41a4f8107c7153daa 100644 --- a/cplusplus/level2_simple_inference/1_classification/vdec_resnet50_classification/README_CN.md +++ b/cplusplus/level2_simple_inference/1_classification/vdec_resnet50_classification/README_CN.md @@ -89,19 +89,19 @@ 2. 将ResNet-50网络转换为适配昇腾AI处理器的离线模型(\*.om文件),转换模型时,需配置色域转换参数,用于将YUV420SP格式的图片转换为RGB格式的图片。 - 切换到样例目录,执行如下命令(以昇腾310 AI处理器为例): + 切换到样例目录,执行atc命令,命令示例如下,请根据参数说明调整参数值后,再执行命令: ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version=Ascend310 --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version= --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp ``` - - --model:原始模型文件路径。 - - --weight:权重文件路径。 - - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。 - - --soc\_version:昇腾AI处理器的版本。进入“CANN软件安装目录/compiler/data/platform_config”目录,".ini"文件的文件名即为昇腾AI处理器的版本,请根据实际情况选择。 + - --model:原始模型文件路径。直接使用命令示例中的路径,无需修改。 + - --weight:权重文件路径。直接使用命令示例中的路径,无需修改。 + - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。直接使用命令示例中的参数值,无需修改。 + - --soc\_version:昇腾AI处理器的版本。需根据实际情况修改。若无法确定当前设备的soc_version,可在安装昇腾AI处理器的服务器上执行npu-smi info命令进行查询,获取Name信息,实际配置值为AscendName,例如Name取值为xxxyy,实际配置值为Ascendxxxyy。 - - --insert\_op\_conf:插入AIPP(AI Preprocessing)算子的配置文件路径,用于在AI Core上完成图像预处理,包括改变图像尺寸、色域转换(转换图像格式)、减均值/乘系数(改变图像像素),数据处理之后再进行真正的模型推理。 - - --output:生成的resnet50\_aipp.om文件存放在“样例目录/model“目录下。建议使用命令中的默认设置,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 + - --insert\_op\_conf:插入AIPP(AI Preprocessing)算子的配置文件路径,用于在AI Core上完成图像预处理,包括改变图像尺寸、色域转换(转换图像格式)、减均值/乘系数(改变图像像素),数据处理之后再进行真正的模型推理。直接使用命令示例中的路径,无需修改。 + - --output:生成的resnet50\_aipp.om文件存放在“样例目录/model“目录下。建议使用命令示例中的路径,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 ``` const char* omModelPath = "../model/resnet50_aipp.om"; diff --git a/cplusplus/level2_simple_inference/1_classification/vpc_jpeg_resnet50_imagenet_classification/README.md b/cplusplus/level2_simple_inference/1_classification/vpc_jpeg_resnet50_imagenet_classification/README.md index 969ef5dc40cbb4916e601bd46d682928b5602270..b12aa662a0a9ef4c5e24f7e83318b93d9468af15 100644 --- a/cplusplus/level2_simple_inference/1_classification/vpc_jpeg_resnet50_imagenet_classification/README.md +++ b/cplusplus/level2_simple_inference/1_classification/vpc_jpeg_resnet50_imagenet_classification/README.md @@ -83,16 +83,16 @@ The sample directory is organized as follows: 2. Convert the ResNet-50 network into an offline model \(.om file\) that adapts to Ascend AI Processors. During model conversion, you need to set CSC parameters to convert YUV420SP images to RGB images. - Go to the sample directory and run the following command (take Ascend310 as an example): + Go to the example directory and execute the atc command. The command example is as follows. Plaease adjust the parameter values according to the parameter description before executing the command. ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version=Ascend310 --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version= --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp ``` - **--model**: directory of the source model file. - **--weight**: directory of the weight file. - **--framework**: source framework type, selected from **0** \(Caffe\), **1** \(MindSpore\), **3** \(TensorFlow\), and **5** \(ONNX\). - - **--soc\_version**: Version of the Ascend AI processor. Go to the CANN software installation directory/compiler/data/platform_config directory. The name of the .ini file is the version of the Ascend AI processor. Select the version as required. + - **--soc\_version**: Version of the Ascend AI processor. Modify the as required. If the cannot be determined, please run the **npu-smi info** command on the server where the Ascend AI Processor is installed to obtain the Chip Name information. The actual value is Ascend+Name. For example, if Chip Name is xxxyy, the actual value is Ascendxxxyy. - **--insert\_op\_conf**: path of the configuration file for inserting the AI Pre-Processing \(AIPP\) operator for AI Core–based image preprocessing including image resizing, CSC, and mean subtraction and factor multiplication \(for pixel changing\), prior to model inference. - **--output**: directory for storing the generated **resnet50\_aipp.om** file, that is, **/model** under the sample directory. The default path in the command example is recommended. To specify another path, you need to change the value of **omModelPath** in **sample\_process.cpp** before building the code. diff --git a/cplusplus/level2_simple_inference/1_classification/vpc_jpeg_resnet50_imagenet_classification/README_CN.md b/cplusplus/level2_simple_inference/1_classification/vpc_jpeg_resnet50_imagenet_classification/README_CN.md index 8ba98cb9fc595102eaab9fe6f6476d32e79fc336..4b88f9250dc851e681dd3525d15ea3cfbb508a51 100644 --- a/cplusplus/level2_simple_inference/1_classification/vpc_jpeg_resnet50_imagenet_classification/README_CN.md +++ b/cplusplus/level2_simple_inference/1_classification/vpc_jpeg_resnet50_imagenet_classification/README_CN.md @@ -85,19 +85,19 @@ 2. 将ResNet-50网络转换为适配昇腾AI处理器的离线模型(\*.om文件),转换模型时,需配置色域转换参数,用于将YUV420SP格式的图片转换为RGB格式的图片。 - 切换到样例目录,执行如下命令: + 切换到样例目录,执行atc命令,命令示例如下,请根据参数说明调整参数值后,再执行命令: ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version=Ascend310 --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version= --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp ``` - - --model:原始模型文件路径。 - - --weight:权重文件路径。 - - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。 - - --soc\_version:昇腾AI处理器的版本。进入“CANN软件安装目录/compiler/data/platform_config”目录,".ini"文件的文件名即为昇腾AI处理器的版本,请根据实际情况选择。 + - --model:原始模型文件路径。直接使用命令示例中的路径,无需修改。 + - --weight:权重文件路径。直接使用命令示例中的路径,无需修改。 + - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。直接使用命令示例中的参数值,无需修改。 + - --soc\_version:昇腾AI处理器的版本。需根据实际情况修改。 若无法确定当前设备的soc_version,可在安装昇腾AI处理器的服务器上执行npu-smi info命令进行查询,获取Name信息,实际配置值为AscendName,例如Name取值为xxxyy,实际配置值为Ascendxxxyy。 - - --insert\_op\_conf:插入AIPP(AI Preprocessing)算子的配置文件路径,用于在AI Core上完成图像预处理,包括改变图像尺寸、色域转换(转换图像格式)、减均值/乘系数(改变图像像素),数据处理之后再进行真正的模型推理。 - - --output:生成的resnet50\_aipp.om文件存放在“样例目录/model“目录下。建议使用命令中的默认设置,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 + - --insert\_op\_conf:插入AIPP(AI Preprocessing)算子的配置文件路径,用于在AI Core上完成图像预处理,包括改变图像尺寸、色域转换(转换图像格式)、减均值/乘系数(改变图像像素),数据处理之后再进行真正的模型推理。直接使用命令示例中的路径,无需修改。 + - --output:生成的resnet50\_aipp.om文件存放在“样例目录/model“目录下。建议使用命令示例中的路径,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 ``` const char* omModelPath = "../model/resnet50_aipp.om"; diff --git a/cplusplus/level2_simple_inference/1_classification/vpc_resnet50_imagenet_classification/README.md b/cplusplus/level2_simple_inference/1_classification/vpc_resnet50_imagenet_classification/README.md index 1927fa7c840c64053a9bf8343c0d89e3d95b0230..a8cf42fe1858792fe1a157828981a19a44587586 100644 --- a/cplusplus/level2_simple_inference/1_classification/vpc_resnet50_imagenet_classification/README.md +++ b/cplusplus/level2_simple_inference/1_classification/vpc_resnet50_imagenet_classification/README.md @@ -83,16 +83,16 @@ The sample directory is organized as follows: 2. Convert the ResNet-50 network into an offline model \(.om file\) that adapts to Ascend AI Processors. During model conversion, you need to set CSC parameters to convert YUV420SP images to RGB images. - Go to the sample directory and run the following command (take Ascend310 as an example): + Go to the example directory and execute the atc command. The command example is as follows. Plaease adjust the parameter values according to the parameter description before executing the command. ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version=Ascend310 --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version= --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp ``` - **--model**: directory of the source model file. - **--weight**: directory of the weight file. - **--framework**: source framework type, selected from **0** \(Caffe\), **1** \(MindSpore\), **3** \(TensorFlow\), and **5** \(ONNX\). - - **--soc\_version**: Version of the Ascend AI processor. Go to the CANN software installation directory/compiler/data/platform_config directory. The name of the .ini file is the version of the Ascend AI processor. Select the version as required. + - **--soc\_version**: Version of the Ascend AI processor. Modify the as required. If the cannot be determined, please run the **npu-smi info** command on the server where the Ascend AI Processor is installed to obtain the Chip Name information. The actual value is Ascend+Name. For example, if Chip Name is xxxyy, the actual value is Ascendxxxyy. - **--insert\_op\_conf**: path of the configuration file for inserting the AI Pre-Processing \(AIPP\) operator for AI Core–based image preprocessing including image resizing, CSC, and mean subtraction and factor multiplication \(for pixel changing\), prior to model inference. - **--output**: directory for storing the generated **resnet50\_aipp.om** file, that is, **/model** under the sample directory. The default path in the command example is recommended. To specify another path, you need to change the value of **omModelPath** in **sample\_process.cpp** before building the code. diff --git a/cplusplus/level2_simple_inference/1_classification/vpc_resnet50_imagenet_classification/README_CN.md b/cplusplus/level2_simple_inference/1_classification/vpc_resnet50_imagenet_classification/README_CN.md index 864e1a4a72e40b5c2a05007d405efe40452323b8..4c97d00e555ba515e9106c4e3cc0281fa12a4137 100644 --- a/cplusplus/level2_simple_inference/1_classification/vpc_resnet50_imagenet_classification/README_CN.md +++ b/cplusplus/level2_simple_inference/1_classification/vpc_resnet50_imagenet_classification/README_CN.md @@ -88,18 +88,18 @@ 2. 将ResNet-50原始模型转换为适配昇腾AI处理器的离线模型(\*.om文件),转换模型时,需配置色域转换参数,用于将YUV420SP格式的图片转换为RGB格式的图片。 - 切换到样例目录,执行如下命令(以昇腾310 AI处理器为例): + 切换到样例目录,执行atc命令,命令示例如下,请根据参数说明调整参数值后,再执行命令: ``` - atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version=Ascend310 --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp + atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --soc_version= --insert_op_conf=caffe_model/aipp.cfg --output=model/resnet50_aipp ``` - - --model:原始模型文件路径。 - - --weight:权重文件路径。 - - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。 - - --soc\_version:昇腾AI处理器的版本。进入“CANN软件安装目录/compiler/data/platform_config”目录,".ini"文件的文件名即为昇腾AI处理器的版本,请根据实际情况选择。 - - --insert\_op\_conf:插入AIPP(AI Preprocessing)算子的配置文件路径,用于在AI Core上完成图像预处理,包括改变图像尺寸、色域转换(转换图像格式)、减均值/乘系数(改变图像像素),数据处理之后再进行真正的模型推理。 - - --output:生成的resnet50\_aipp.om文件存放在“样例目录/model“目录下。建议使用命令中的默认设置,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 + - --model:原始模型文件路径。直接使用命令示例中的路径,无需修改。 + - --weight:权重文件路径。直接使用命令示例中的路径,无需修改。 + - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。直接使用命令示例中的参数值,无需修改。 + - --soc\_version:昇腾AI处理器的版本。需根据实际情况修改。 若无法确定当前设备的soc_version,可在安装昇腾AI处理器的服务器上执行npu-smi info命令进行查询,获取Name信息,实际配置值为AscendName,例如Name取值为xxxyy,实际配置值为Ascendxxxyy。 + - --insert\_op\_conf:插入AIPP(AI Preprocessing)算子的配置文件路径,用于在AI Core上完成图像预处理,包括改变图像尺寸、色域转换(转换图像格式)、减均值/乘系数(改变图像像素),数据处理之后再进行真正的模型推理。直接使用命令示例中的路径,无需修改。 + - --output:生成的resnet50\_aipp.om文件存放在“样例目录/model“目录下。建议使用命令示例中的路径,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 ``` const char* omModelPath = "../model/resnet50_aipp.om"; diff --git a/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_dynamic_batch_detection_picture/README.md b/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_dynamic_batch_detection_picture/README.md index b848f220593bc3a8314a3d293efb60ec9794921b..ff603339c108dc659743fbd6ca4f3223f4c80a8a 100644 --- a/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_dynamic_batch_detection_picture/README.md +++ b/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_dynamic_batch_detection_picture/README.md @@ -69,16 +69,16 @@ The directory structure of the sample is as follows: 2. Switch to the sample directory and convert the YOLOv3 network into an OM offline model (**\*.om** file) that adapts to the Ascend AI Processor. - If the input for model inference allows a dynamic batch size, run the following command to convert the model (taking the Ascend 310 AI Processor as an example): + If the input for model inference allows a dynamic batch size, the command example is as follows. Plaease adjust the parameter values according to the parameter description before executing the command: ``` - atc --model=caffe_model/yolov3.prototxt --weight=caffe_model/yolov3.caffemodel --framework=0 --input_shape="data:-1,3,416,416;img_info:-1,4" --input_format=NCHW --dynamic_batch_size="1,2,4,8" --soc_version=Ascend310 --output=model/yolov3_dynamic_batch + atc --model=caffe_model/yolov3.prototxt --weight=caffe_model/yolov3.caffemodel --framework=0 --input_shape="data:-1,3,416,416;img_info:-1,4" --input_format=NCHW --dynamic_batch_size="1,2,4,8" --soc_version= --output=model/yolov3_dynamic_batch ``` - If the input for model inference allows a dynamic image size, run the following command to convert the model (taking the Ascend 310 AI Processor as an example): + If the input for model inference allows a dynamic image size, the command example is as follows. Plaease adjust the parameter values according to the parameter description before executing the command: ``` - atc --model=caffe_model/yolov3.prototxt --weight=caffe_model/yolov3.caffemodel --framework=0 --input_shape="data:1,3,-1,-1" --input_format=NCHW --dynamic_image_size="416,416;832,832;1248,1248" --soc_version=Ascend310 --output=model/yolov3_dynamic_hw + atc --model=caffe_model/yolov3.prototxt --weight=caffe_model/yolov3.caffemodel --framework=0 --input_shape="data:1,3,-1,-1" --input_format=NCHW --dynamic_image_size="416,416;832,832;1248,1248" --soc_version= --output=model/yolov3_dynamic_hw ``` - --**model**: directory of the source model file. @@ -88,7 +88,7 @@ The directory structure of the sample is as follows: - --**input\_format**: input format. - --**dynamic\_batch\_size**: dynamic batch size profiles. Applies to the scenario where image count per inference batch is unfixed. - --**dynamic\_image\_size**: dynamic image size profiles. Applies to the scenario where image size per inference batch is unfixed. - - --**soc\_version**: Version of the Ascend AI processor. Go to the CANN software installation directory/compiler/data/platform_config directory. The name of the .ini file is the version of the Ascend AI processor. Select the version as required. + - --**soc\_version**: Version of the Ascend AI processor. Modify the as required. If the cannot be determined, please run the **npu-smi info** command on the server where the Ascend AI Processor is installed to obtain the Chip Name information. The actual value is Ascend+Name. For example, if Chip Name is xxxyy, the actual value is Ascendxxxyy. - --**output**: directory for storing the generated **yolov3\_dynamic\_batch.om** or **yolov3\_dynamic\_hw.om** file, that is, **/model** under the sample directory. The default path in the command example is recommended. To specify another path, change the value of **omModelPath** in **sample\_process.cpp** before building the code. ``` diff --git a/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_dynamic_batch_detection_picture/README_CN.md b/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_dynamic_batch_detection_picture/README_CN.md index 10943ae27cd512b93824a6fc0df6bb4033678517..4772e1b096ad009a01ce89148e3d1d3413706d9d 100644 --- a/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_dynamic_batch_detection_picture/README_CN.md +++ b/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_dynamic_batch_detection_picture/README_CN.md @@ -65,27 +65,27 @@ 2. 切换到样例目录,将yolov3网络转换为适配昇腾AI处理器的离线模型(\*.om文件)。 - 如果模型推理的输入数据是动态Batch的,执行如下命令转换模型(以昇腾310 AI处理器为例): + 如果模型推理的输入数据是动态Batch的,命令示例如下,请根据参数说明调整参数值后,再执行命令: ``` - atc --model=caffe_model/yolov3.prototxt --weight=caffe_model/yolov3.caffemodel --framework=0 --input_shape="data:-1,3,416,416;img_info:-1,4" --input_format=NCHW --dynamic_batch_size="1,2,4,8" --soc_version=Ascend310 --output=model/yolov3_dynamic_batch + atc --model=caffe_model/yolov3.prototxt --weight=caffe_model/yolov3.caffemodel --framework=0 --input_shape="data:-1,3,416,416;img_info:-1,4" --input_format=NCHW --dynamic_batch_size="1,2,4,8" --soc_version= --output=model/yolov3_dynamic_batch ``` - 如果模型推理的输入数据是动态分辨率的,执行如下命令转换模型(以昇腾310 AI处理器为例): + 如果模型推理的输入数据是动态分辨率的,命令示例如下,请根据参数说明调整参数值后,再执行命令: ``` - atc --model=caffe_model/yolov3.prototxt --weight=caffe_model/yolov3.caffemodel --framework=0 --input_shape="data:1,3,-1,-1" --input_format=NCHW --dynamic_image_size="416,416;832,832;1248,1248" --soc_version=Ascend310 --output=model/yolov3_dynamic_hw + atc --model=caffe_model/yolov3.prototxt --weight=caffe_model/yolov3.caffemodel --framework=0 --input_shape="data:1,3,-1,-1" --input_format=NCHW --dynamic_image_size="416,416;832,832;1248,1248" --soc_version= --output=model/yolov3_dynamic_hw ``` - - --model:原始模型文件路径。 - - --weight:权重文件路径。 - - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。 - - --input\_shape:模型输入数据的Shape。 - - --input\_format:模型输入数据的Format。 - - --dynamic\_batch\_size:设置动态Batch档位参数,适用于执行推理时,每次处理图片数量不固定的场景。 - - --dynamic\_image\_size:设置输入图片的动态分辨率参数,适用于执行推理时,每次处理图片宽和高不固定的场景。 - - --soc\_version:昇腾AI处理器的版本。进入“CANN软件安装目录/compiler/data/platform_config”目录,".ini"文件的文件名即为昇腾AI处理器的版本,请根据实际情况选择。 - - --output:生成的yolov3\_dynamic\_batch.om或者yolov3\_dynamic\_hw.om文件存放在“样例目录/model“目录下。建议使用命令中的默认设置,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 + - --model:原始模型文件路径。直接使用命令示例中的路径,无需修改。 + - --weight:权重文件路径。直接使用命令示例中的路径,无需修改。 + - --framework:原始框架类型。0:表示Caffe;1:表示MindSpore;3:表示TensorFlow;5:表示ONNX。直接使用命令示例中的参数值,无需修改。 + - --input\_shape:模型输入数据的Shape。直接使用命令示例中的参数值,无需修改。 + - --input\_format:模型输入数据的Format。直接使用命令示例中的参数值,无需修改。 + - --dynamic\_batch\_size:设置动态Batch档位参数,适用于执行推理时,每次处理图片数量不固定的场景。直接使用命令示例中的参数值,无需修改。 + - --dynamic\_image\_size:设置输入图片的动态分辨率参数,适用于执行推理时,每次处理图片宽和高不固定的场景。直接使用命令示例中的参数值,无需修改。 + - --soc\_version:昇腾AI处理器的版本。需根据实际情况修改。若无法确定当前设备的soc_version,可在安装昇腾AI处理器的服务器上执行npu-smi info命令进行查询,获取Name信息,实际配置值为AscendName,例如Name取值为xxxyy,实际配置值为Ascendxxxyy。 + - --output:生成的yolov3\_dynamic\_batch.om或者yolov3\_dynamic\_hw.om文件存放在“样例目录/model“目录下。建议使用命令示例中的路径,否则在编译代码前,您还需要修改sample\_process.cpp中的omModelPath参数值。 ``` string omModelPath = "../model/yolov3_dynamic_batch.om";