diff --git a/docs/lite/api/source_en/api_java/model.md b/docs/lite/api/source_en/api_java/model.md index 8a170203a5479356d44fc770c6ddc0adf10bb38a..a3dad603b8f0fefb73ef58b6068e3b4ff717eaca 100644 --- a/docs/lite/api/source_en/api_java/model.md +++ b/docs/lite/api/source_en/api_java/model.md @@ -288,7 +288,7 @@ Update config. ## export ```java -public boolean export(String fileName, int quantizationType, boolean isOnlyExportInfer,List outputTensorNames) +public boolean export(String fileName, int quantizationType, boolean isOnlyExportInfer, List outputTensorNames) ``` Export the model. diff --git a/docs/lite/api/source_zh_cn/api_java/model.md b/docs/lite/api/source_zh_cn/api_java/model.md index e1db2a369b7b10b8536f6b2a7549cdb7dd1f226e..c9c99147afd0cc388697e074b3f8a6ba3ace569e 100644 --- a/docs/lite/api/source_zh_cn/api_java/model.md +++ b/docs/lite/api/source_zh_cn/api_java/model.md @@ -288,7 +288,7 @@ public boolean updateConfig(String section, HashMap config) ## export ```java -public boolean export(String fileName, int quantizationType, boolean isOnlyExportInfer,List outputTensorNames) +public boolean export(String fileName, int quantizationType, boolean isOnlyExportInfer, List outputTensorNames) ``` 导出模型。 diff --git a/docs/lite/docs/source_en/reference/architecture_lite.md b/docs/lite/docs/source_en/reference/architecture_lite.md index f8913815699bc7ddb6cddf9b58ce7e789143f01e..67519007170c2d211d17a9fea4b99d0526998282 100644 --- a/docs/lite/docs/source_en/reference/architecture_lite.md +++ b/docs/lite/docs/source_en/reference/architecture_lite.md @@ -32,6 +32,6 @@ MindSpore Lite is divided into two parts: offline module and online module. The - **Delegate:** agent for docking professional AI hardware engine. - - **Kernels:** the built-in high-performance operator library which provides CPU, GPU and NPU operators. + - **Kernels:** the built-in high-performance operator library that provides CPU, GPU and NPU operators. - **Learning Strategies:** device-side learning strategies, such as transfer learning. diff --git a/docs/lite/docs/source_en/reference/faq.md b/docs/lite/docs/source_en/reference/faq.md index da0a9e1af744aacd3b390e683f6bd59ef86b7a82..31178ad54d13fac7b64481f71abf23ebfa927a25 100644 --- a/docs/lite/docs/source_en/reference/faq.md +++ b/docs/lite/docs/source_en/reference/faq.md @@ -59,7 +59,7 @@ If you encounter an issue when using MindSpore Lite, you can view logs first. In 1. For dynamic shape models, you need to set `--inputShape=` listed in the [Parameter Description](https://www.mindspore.cn/lite/docs/en/master/converter/converter_tool.html#parameter-description). For example: ``` - ./converter_lite --fmk=ModelType --modelFile=ModelFilePath --outputFile=ConvertedModelPath --configFile=/mindspore-lite/tools/converter/quantizer/config/full_quant.cfg --inputShape=intput_1:1,224,224,3;intput_2:1,48; + ./converter_lite --fmk=ModelType --modelFile=ModelFilePath --outputFile=ConvertedModelPath --configFile=/mindspore-lite/tools/converter/quantizer/config/full_quant.cfg --inputShape=input_1:1,224,224,3;input_2:1,48; ``` 2. For a multi-batch model, the data preprocessing function cannot be directly used. You need to preprocess the calibration dataset in advance and then set the calibration dataset in the `BIN` format. @@ -384,7 +384,7 @@ If you encounter an issue when using MindSpore Lite, you can view logs first. In ## Other Issues -**Q: Why does a device not take effect after being specified as a GPU or NPU?* +**Q: Why does a device not take effect after being specified as a GPU or NPU?** A: The device priority depends on the configuration sequence. Ensure that the GPU or NPU configuration in the context is prior to the CPU configuration. @@ -392,24 +392,24 @@ A: The device priority depends on the configuration sequence. Ensure that the GP **Q: How many log levels are supported by MindSpore Lite? How can I set the log level?** -A: Currently MindSpore Lite supports 4 log levels, including DEBUG, INFO, WARNING and ERROR. Users can set log level by set environment parameter GLOG_v. This environment parameter ranges from 0 to 3, which represents DEBUG, INFO, WARNING and ERROR. The default log level is WARNING or ERROR. For example, if the user sets GLOG_v to 1, MindSpore Lite will print the log of INFO level or higher. +A: Currently MindSpore Lite supports 4 log levels, including DEBUG, INFO, WARNING and ERROR. Users can set log level by setting environment parameter GLOG_v. This environment parameter ranges from 0 to 3, which represents DEBUG, INFO, WARNING and ERROR. The default log level is WARNING or ERROR. For example, if the user sets GLOG_v to 1, MindSpore Lite will print the log of INFO level or higher.
**Q: What are the limitations of NPU?** -A: Currently NPU only supports system ROM version EMUI>=11. Chip support includes Kirin 9000, Kirin 9000E, Kirin 990, Kirin 985, Kirin 820, Kirin 810, etc. For specific constraints and chip support, please see: . +A: Currently NPU only supports system ROM version EMUI>=11. Chip support includes Kirin 9000, Kirin 9000E, Kirin 990, Kirin 985, Kirin 820, Kirin 810, etc. For specific constraints and chip support, please see: .
**Q: Why does the static library after cutting with the cropper tool fail to compile during integration?** -A: Currently the cropper tool only supports CPU and GPU libraries. For details, please refer to [Use clipping tool to reduce library file size](https://www.mindspore.cn/lite/docs/en/master/tools/cropper_tool.html) document. +A: Currently the cropper tool only supports CPU and GPU libraries. For details, please refer to [Use clipping tool to reduce library file size](https://www.mindspore.cn/lite/docs/en/master/tools/cropper_tool.html) document.
**Q: Will MindSpore Lite run out of device memory, when running model?** -A: Currently the MindSpore Lite built-in memory pool has a maximum capacity limit 3GB. If a model is bigger than 3GB, MindSpore Lite will throw error. +A: Currently the MindSpore Lite built-in memory pool has a maximum capacity limit of 3GB. If a model is bigger than 3GB, MindSpore Lite will throw an error. **Q: How do I visualize the MindSpore Lite offline model (.ms file) to view the network structure?** @@ -425,7 +425,7 @@ A: [MindSpore Lite](https://www.mindspore.cn/lite/en) supports the inference of **Q: Does MindSpore Lite have a lightweight on-device inference engine?** -A:The MindSpore Lite lightweight inference framework MindSpore Lite has been officially launched in r0.7. You are welcome to try it and give your comments. For details about the overview, tutorials, and documents, see [MindSpore Lite](https://www.mindspore.cn/lite/en). +A: The MindSpore Lite lightweight inference framework MindSpore Lite has been officially launched in r0.7. You are welcome to try it and give your comments. For details about the overview, tutorials, and documents, see [MindSpore Lite](https://www.mindspore.cn/lite/en).
diff --git a/docs/lite/docs/source_en/reference/image_classification_lite.md b/docs/lite/docs/source_en/reference/image_classification_lite.md index 226025c519c414badd1d1f1ea776104cc4ad1959..a53d8b3e6a3c741145355c9ad26652fe1ded2c9b 100644 --- a/docs/lite/docs/source_en/reference/image_classification_lite.md +++ b/docs/lite/docs/source_en/reference/image_classification_lite.md @@ -4,7 +4,7 @@ ## Image Classification Introduction -Image classification model is to identity what an image represents, to predict the object list and the probabilities. For example, the following table shows the classification results after mode inference. +Image classification model is to identify what an image represents, to predict the object list and the probabilities. For example, the following table shows the classification results after model inference. ![image_classification](images/image_classification_result.png) @@ -21,7 +21,7 @@ Use MindSpore Lite to realize image classification [example](https://gitee.com/m The following table shows the data of some image classification models using MindSpore Lite inference. -> The performance of the table below is tested on the mate30. +> The performance of the table below is tested on the Mate30. | Model name | Size(Mb) | Top1 | Top5 | F1 | CPU 4 thread delay (ms) | |-----------------------| :----------: | :----------: | :----------: | :----------: | :-----------: | diff --git a/docs/lite/docs/source_en/reference/image_segmentation_lite.md b/docs/lite/docs/source_en/reference/image_segmentation_lite.md index 2a2bcedd29439f95a429318143abb2f6fbc5a4e5..fe75e761270a57d925843d58cb676acb8e5fc063 100644 --- a/docs/lite/docs/source_en/reference/image_segmentation_lite.md +++ b/docs/lite/docs/source_en/reference/image_segmentation_lite.md @@ -12,7 +12,7 @@ Using MindSpore Lite to perform image segmentation [example](https://gitee.com/m The following table shows the data of some image segmentation models using MindSpore Lite inference. -> The performance of the table below is tested on the mate30. +> The performance of the table below is tested on the Mate30. | Model name | Size(Mb) | IoU | CPU 4 thread delay (ms) | |-----------------------| :----------: | :----: | :-----------: | diff --git a/docs/lite/docs/source_en/reference/log.md b/docs/lite/docs/source_en/reference/log.md index 24a5249e3d41861e91db09273bc774c6f78a60e4..3626016a4aa7c188c5a28b7b96143b4b82a0439c 100644 --- a/docs/lite/docs/source_en/reference/log.md +++ b/docs/lite/docs/source_en/reference/log.md @@ -22,7 +22,7 @@ Only server inference version and windows version support environment variables ## User-defined GLOG Options -`Mindpoint lite` supports user-defined configuration of `GLOG` related parameters for specific situations. Users can set `GLOG_USER_DEFINE` parameter to `on` to achieve custom configuration of logs. For specific GLOG options, you can use `FLAGS_**` Configure. Please refer to the table below for detailed configuration. +`MindSpore lite` supports user-defined configuration of `GLOG` related parameters for specific situations. Users can set `GLOG_USER_DEFINE` parameter to `on` to achieve custom configuration of logs. For specific GLOG options, you can use `FLAGS_**` to configure. Please refer to the table below for detailed configuration. | Configuration item | Definition | |-----------------------| :----------: | diff --git a/docs/lite/docs/source_en/reference/object_detection_lite.md b/docs/lite/docs/source_en/reference/object_detection_lite.md index 48df62cb80bc2b1b1c05bbf63c06ed99c72e7cb2..560c043f905d31a21e77f91bf592d54d7b429e97 100644 --- a/docs/lite/docs/source_en/reference/object_detection_lite.md +++ b/docs/lite/docs/source_en/reference/object_detection_lite.md @@ -4,9 +4,9 @@ ## Object Detection Introduction -Object detection can identify the object in the image and its position in the image. For the following figure, the output of the object detection model is shown in the following table. The rectangular box is used to identify the position of the object in the graph and to mark the probability of the object category. The four numbers in the coordinates are Xmin, Ymin, Xmax, Ymax; the probability represents the probility of the detected object. +Object detection can identify the object in the image and its position in the image. For the following figure, the output of the object detection model is shown in the following table. The rectangular box is used to identify the position of the object in the graph and to mark the probability of the object category. The four numbers in the coordinates are Xmin, Ymin, Xmax, Ymax; the probability represents the probability of the detected object. -![object_detectiontion](images/object_detection.png) +![object_detection](images/object_detection.png) | Category | Probability | Coordinate | | -------- | ----------- | ---------------- | @@ -18,7 +18,7 @@ Using MindSpore Lite to implement object detection [example](https://gitee.com/m The following table shows the data of some object detection models using MindSpore Lite inference. -> The performance of the table below is tested on the mate30. +> The performance of the table below is tested on the Mate30. | Model name | Size(Mb) | mAP(IoU=0.50:0.95) | CPU 4 thread delay (ms) | |-----------------------| :----------: | :----------: | :-----------: | diff --git a/docs/lite/docs/source_en/reference/operator_list_codegen.md b/docs/lite/docs/source_en/reference/operator_list_codegen.md index 2362309485402daf57f8fef2df44dc750cd4e84c..bc36a77be4c5b73371546fb6f4bc0291a952d4f8 100644 --- a/docs/lite/docs/source_en/reference/operator_list_codegen.md +++ b/docs/lite/docs/source_en/reference/operator_list_codegen.md @@ -22,7 +22,7 @@ This article lists the operators supported by MindSpore Lite Codegen. | Eltwise | ✅ | | | | Eltwise | Sum, Max[3] | | | Equal | ✅ | | | Equal | | Equal | Equal | | ExpandDims | ✅ | | | ExpandDims | | | ExpandDims | -| Floor | ✅ | | | flOOR | | Floor | | +| Floor | ✅ | | | Floor | | Floor | | | FloorDiv | ✅ | | | FloorDiv | | | | | FloorMod | ✅ | | | FloorMod | | | | | FullConnection | ✅ | ✅ | ✅ | FullyConnected | InnerProduct | | | @@ -43,7 +43,7 @@ This article lists the operators supported by MindSpore Lite Codegen. | NotEqual | ✅ | | | NotEqual | | |NotEqual | | ReLU | ✅ | ✅ | ✅ | Relu | ReLU | Relu | Relu | | ReLU6 | ✅ | ✅ | ✅ | Relu6 | ReLU6 | Clip[1] | Relu6 | -| Reshape | ✅ | ✅ | ✅ | Reshape | Reshape | Reshape,Flatten | Reshape | +| Reshape | ✅ | ✅ | ✅ | Reshape | Reshape | Reshape, Flatten | Reshape | | Resize | | ✅ | | ResizeBilinear,
NearestNeighbor | Interp | | | | Round | ✅ | | | Round | | Round | Round | | Rsqrt | ✅ | | | Rsqrt | | | | diff --git a/docs/lite/docs/source_en/reference/operator_list_lite_for_onnx.md b/docs/lite/docs/source_en/reference/operator_list_lite_for_onnx.md index 3d2f2474237870de84c81a6165e9ee118495c66c..925921119ebe1b665495ebbff5d71a87e013e77a 100644 --- a/docs/lite/docs/source_en/reference/operator_list_lite_for_onnx.md +++ b/docs/lite/docs/source_en/reference/operator_list_lite_for_onnx.md @@ -38,7 +38,6 @@ | Flatten | Data is expanded by dimension | Flatten | Does not support the uint8 type. | | Floor | Round down to the nearest integer | Floor | - | | FusedBatchNorm | Standardize the input | BatchNormalization | - | -| GatherNd | Collect elements from the input tensor at specified positions based on the index tensor. | GatherND | - | | Gather | Collect elements at specified index positions along a single dimension | Gather | Does not support the uint8 type. Does not support the QuantType_QUANT_NONE quantization type. | | GatherD | Collect elements from the input tensor based on the index tensor. | GatherElements | - | | GatherNd | Aggregate slices of the input tensor into a new tensor with dimensions specified by indices. | GatherND | - | @@ -47,7 +46,6 @@ | InstanceNorm | Instance normalization | InstanceNormalization | - | | LeakyReLU | Leaky ReLU activation function, which assigns a small slope to negative inputs. | LeakyRelu | - | | Less | Perform element-wise comparison between two tensors, returning a logical result indicating whether A < B. | Less | - | -| LRN | Local response normalization | Lrn, LRN | - | | Log | Element-wise calculate the logarithm | Log | Does not accept negative numbers. | | LogicalAnd | Element-wise logical AND operation | And | - | | LogicalNot | Element-level logical NOT operation | Not | - | diff --git a/docs/lite/docs/source_en/reference/style_transfer_lite.md b/docs/lite/docs/source_en/reference/style_transfer_lite.md index 9c6928441b4930db5f692de5e959534ff96bc76e..0801b7e2af54e9802e920e0a3328815aef39c3f1 100644 --- a/docs/lite/docs/source_en/reference/style_transfer_lite.md +++ b/docs/lite/docs/source_en/reference/style_transfer_lite.md @@ -10,7 +10,7 @@ Using demo to open the target image: ![image_before_transfer](images/before_transfer.png) -Selecting the first standard image from left to perform the style transfer, as shown in the figure: +Selecting the first standard image from the left to perform the style transfer, as shown in the figure: ![image_after_transfer](images/after_transfer.png) diff --git a/docs/lite/docs/source_en/tools/benchmark_golden_data.md b/docs/lite/docs/source_en/tools/benchmark_golden_data.md index 61fef80ec14a3686f5bf7fea653aec5665702083..624a2b529b7c1b66dc21cb681d61232ecb2902b3 100644 --- a/docs/lite/docs/source_en/tools/benchmark_golden_data.md +++ b/docs/lite/docs/source_en/tools/benchmark_golden_data.md @@ -31,7 +31,7 @@ python mslite_gold.py --inputFile "/path/to/input.npz" --outputFile "/path/to/ou After executing the command, the following file is generated in the `/path/to/save_data/` directory: - `input.bin`: Input data, `flatten` the data of each input Tensor one-dimensionally and save it separately to a binary file `input.bin` without meta-information such as name, dtype, and shape. -- `output.out`: Output data, all output is saved to a text file with the following format: +- `output.out`: Output data, all outputs are saved to a text file with the following format: Each output Tensor occupies 2 lines: @@ -64,7 +64,7 @@ The following is an example of generating benchmark data from an ONNX model to i The `input.npz` and `output.npz` files are generated in the `/path/to/data_example/` directory. -2. Converts the input and output `npz` files into a benchmark data file. +2. Convert the input and output `npz` files into a benchmark data file. ```bash python mslite_gold.py --inputFile "/path/to/data_example/input.npz" --outputFile "/path/to/data_example/output.npz" --savePath "/path/to/save_data" diff --git a/docs/lite/docs/source_en/tools/benchmark_tool.md b/docs/lite/docs/source_en/tools/benchmark_tool.md index edb3babfd6c6c8a2a67aeea57d36f18863962c61..b1e9c9369abbc85c35a632d32529f203c87b2b88 100644 --- a/docs/lite/docs/source_en/tools/benchmark_tool.md +++ b/docs/lite/docs/source_en/tools/benchmark_tool.md @@ -116,11 +116,11 @@ Model = model.ms, numThreads = 2, MinRunTime = 72.228996 ms, MaxRuntime = 73.094 ./benchmark --modelFile=/path/to/model.ms --timeProfiling=true ``` -This command uses a random input, sets the parameter `timeProfiling` as true, and other parameters use default values. After this command is executed, the statistics on the running time of the model at the network layer will be displayed as follows. In this case, the statistics are displayed by`opName` and `optype`. `opName` indicates the operator name, `optype` indicates the operator type, and `avg` indicates the average running time of the operator per single run, `percent` indicates the ratio of the operator running time to the total operator running time, `calledTimess` indicates the number of times that the operator is run, and `opTotalTime` indicates the total time that the operator is run for a specified number of times. Finally, `total time` and `kernel cost` show the average time consumed by a single inference operation of the model and the sum of the average time consumed by all operators in the model inference, respectively. +This command uses a random input, sets the parameter `timeProfiling` as true, and other parameters use default values. After this command is executed, the statistics on the running time of the model at the network layer will be displayed as follows. In this case, the statistics are displayed by `opName` and `optype`. `opName` indicates the operator name, `optype` indicates the operator type, and `avg` indicates the average running time of the operator per single run, `percent` indicates the ratio of the operator running time to the total operator running time, `calledTimes` indicates the number of times that the operator is run, and `opTotalTime` indicates the total time that the operator is run for a specified number of times. Finally, `total time` and `kernel cost` show the average time consumed by a single inference operation of the model and the sum of the average time consumed by all operators in the model inference, respectively. ```text ----------------------------------------------------------------------------------------- -opName avg(ms) percent calledTimess opTotalTime +opName avg(ms) percent calledTimes opTotalTime conv2d_1/convolution 2.264800 0.824012 10 22.648003 conv2d_2/convolution 0.223700 0.081390 10 2.237000 dense_1/BiasAdd 0.007500 0.002729 10 0.075000 @@ -138,7 +138,7 @@ reshape_1/Reshape/shape 0.009900 reshape_1/Shape 0.002300 0.000837 10 0.023000 reshape_1/strided_slice 0.009700 0.003529 10 0.097000 ----------------------------------------------------------------------------------------- -opType avg(ms) percent calledTimess opTotalTime +opType avg(ms) percent calledTimes opTotalTime Activation 0.006900 0.002510 10 0.069000 BiasAdd 0.012800 0.004657 20 0.128000 Conv2D 2.488500 0.905401 20 24.885004 @@ -222,7 +222,7 @@ Model = model.ms, NumThreads = 1, MinRunTime = 0.104000 ms, MaxRunTime = 0.17900 ----------------------------------------------------------------------------------------- ``` -When `perfEvent` is set as `CACHE`, the columns will be `cache ref(k)`/`cache ref(%)`/`miss(k)`/`miss(%)`, which indicate cache reference times / cache reference ratio / cache miss times / cache miss ratio(to all cache misses, not to cache references); when `perfEvent` is set as `STALL`, the columns will be`frontend(k)`/`frontend(%)`/`backend(k)`/`backend(%)`, which indicate CPU front-end stall cycles / front-end stall cycles ratio / back-end stall cycles / back-end stall cycles ratio. For example: +When `perfEvent` is set as `CACHE`, the columns will be `cache ref(k)`/`cache ref(%)`/`miss(k)`/`miss(%)`, which indicate cache reference times / cache reference ratio / cache miss times / cache miss ratio(to all cache misses, not to cache references); when `perfEvent` is set as `STALL`, the columns will be `frontend(k)`/`frontend(%)`/`backend(k)`/`backend(%)`, which indicate CPU front-end stall cycles / front-end stall cycles ratio / back-end stall cycles / back-end stall cycles ratio. For example: ```bash ./benchmark --modelFile=/path/to/model.ms --perfProfiling=true --perfEvent="CACHE" @@ -238,7 +238,7 @@ Benchmark tool provides Dump function (currently only supports `CPU` and mobile #### Dump Step -1. Create dump json file:`data_dump.json`, the name and location of the JSON file can be customized. +1. Create dump json file: `data_dump.json`, the name and location of the JSON file can be customized. ```json { diff --git a/docs/lite/docs/source_en/tools/benchmark_train_tool.md b/docs/lite/docs/source_en/tools/benchmark_train_tool.md index b37a720980dc88d1b37d31e9775b410a08b30bcc..177aec0e2913259257aa0ae435259d65f4709f67 100644 --- a/docs/lite/docs/source_en/tools/benchmark_train_tool.md +++ b/docs/lite/docs/source_en/tools/benchmark_train_tool.md @@ -4,7 +4,7 @@ ## Overview -The same as `benchmark`, you can use the `benchmark_train` tool to perform benchmark testing on a MindSpore Lite ToD (Train on Device) model. It can not only perform quantitative analysis (performance) on the execution duration the model, but also perform comparative error analysis (accuracy) based on the output of the specified model. +The same as `benchmark`, you can use the `benchmark_train` tool to perform benchmark testing on a MindSpore Lite ToD (Train on Device) model. It can not only perform quantitative analysis (performance) on the execution duration of the model, but also perform comparative error analysis (accuracy) based on the output of the specified model. ## Linux Environment Usage @@ -56,7 +56,7 @@ When using the `benchmark_train` tool to perform benchmark testing, you can set #### Performance Test -The main test indicator of the performance test performed by the `benchmark_train` tool is the duration of a single forward inference. In a performance test, please set `epochs` to a value greater than 1, no need to set benchmark data parameters such as `expectedDataFile` etc. But you can set the parameter `timeProfiling` as True or False to decide whether to print the running time of the model at the network layer on a certain device. The default value of `timeProfiling` is False. For example: +The main test indicator of the performance test performed by the `benchmark_train` tool is the duration of a single forward inference. In a performance test, please set `epochs` to a value greater than 1, no need to set benchmark data parameters such as `expectedDataFile`, etc. But you can set the parameter `timeProfiling` as True or False to decide whether to print the running time of the model at the network layer on a certain device. The default value of `timeProfiling` is False. For example: ```bash ./benchmark_train --modelFile=./models/test_benchmark.ms --epochs=10 @@ -72,11 +72,11 @@ Model = test_benchmark.ms, numThreads = 1, MinRunTime = 72.228996 ms, MaxRuntime ./benchmark_train --modelFile=./models/test_benchmark.ms --epochs=10 --timeProfiling=true ``` -This command uses a random input, sets the parameter `timeProfiling` as true, times and other parameters use default values. After this command is executed, the statistics on the running time of the model at the network layer will be displayed as follows. In this case, the statistics are displayed by`opName` and `optype`. `opName` indicates the operator name, `optype` indicates the operator type, and `avg` indicates the average running time of the operator per single run, `percent` indicates the ratio of the operator running time to the total operator running time, `calledTimess` indicates the number of times that the operator is run, and `opTotalTime` indicates the total time that the operator is run for a specified number of times. Finally, `total time` and `kernel cost` show the average time consumed by a single inference operation of the model and the sum of the average time consumed by all operators in the model inference, respectively. +This command uses a random input, sets the parameter `timeProfiling` as true, times and other parameters use default values. After this command is executed, the statistics on the running time of the model at the network layer will be displayed as follows. In this case, the statistics are displayed by `opName` and `optype`. `opName` indicates the operator name, `optype` indicates the operator type, and `avg` indicates the average running time of the operator per single run, `percent` indicates the ratio of the operator running time to the total operator running time, `calledTimes` indicates the number of times that the operator is run, and `opTotalTime` indicates the total time that the operator is run for a specified number of times. Finally, `total time` and `kernel cost` show the average time consumed by a single inference operation of the model and the sum of the average time consumed by all operators in the model inference, respectively. ```text ----------------------------------------------------------------------------------------- -opName avg(ms) percent calledTimess opTotalTime +opName avg(ms) percent calledTimes opTotalTime conv2d_1/convolution 2.264800 0.824012 10 22.648003 conv2d_2/convolution 0.223700 0.081390 10 2.237000 dense_1/BiasAdd 0.007500 0.002729 10 0.075000 @@ -94,7 +94,7 @@ reshape_1/Reshape/shape 0.009900 reshape_1/Shape 0.002300 0.000837 10 0.023000 reshape_1/strided_slice 0.009700 0.003529 10 0.097000 ----------------------------------------------------------------------------------------- -opType avg(ms) percent calledTimess opTotalTime +opType avg(ms) percent calledTimes opTotalTime Activation 0.006900 0.002510 10 0.069000 BiasAdd 0.012800 0.004657 20 0.128000 Conv2D 2.488500 0.905401 20 24.885004 diff --git a/docs/lite/docs/source_en/tools/cropper_tool.md b/docs/lite/docs/source_en/tools/cropper_tool.md index 9d8124c40c01250d72e1004482ed103b74208342..e2a2de9098738c7284d8506e333d713d95409f89 100644 --- a/docs/lite/docs/source_en/tools/cropper_tool.md +++ b/docs/lite/docs/source_en/tools/cropper_tool.md @@ -18,7 +18,7 @@ To use the Cropper tool, you need to prepare the environment as follows: ## Parameter Description -The command used for crop the static library based on Cropper is as follows: +The command used to crop the static library based on Cropper is as follows: ```text ./cropper [--packageFile=] [--configFile=] @@ -37,7 +37,7 @@ The following describes the parameters in detail. | `--outputFile=` | Optional | The saved path of the cut library `libmindspore-lite.a`, it overwrites the source file by default. | String | - | - | | `--help` | Optional | Displays the help information about the `cropper` command. | - | - | - | -> The configuration file `cropper_mapping_cpu.cfg` `cropper_mapping_gpu.cfg` exists in the `tools/cropper` directory in the `mindspore-lite-{version}-linux-x64` package. +> The configuration files `cropper_mapping_cpu.cfg` and `cropper_mapping_gpu.cfg` exist in the `tools/cropper` directory in the `mindspore-lite-{version}-linux-x64` package. ## Example @@ -91,7 +91,7 @@ Refer to the example steps below. 2. Refer to the [MindSpore Lite compilation](https://www.mindspore.cn/lite/docs/en/master/build/build.html) to compile the runtime package on the specific architecture required. -3. After the compilation is completed, find the command for compiling libminspore-lite.so in the printed compilation information. The following is the print command when compiling the runtime package of arm64 architecture, where `/home/android-ndk-r20b` is the path of the installed Android SDK. +3. After the compilation is completed, find the command for compiling libmindspore-lite.so in the printed compilation information. The following is the print command when compiling the runtime package of arm64 architecture, where `/home/android-ndk-r20b` is the path of the installed Android SDK. ```bash /home/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=/home/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC -D_FORTIFY_SOURCE=2 -O2 -Wall -Werror -Wno-attributes -Wno-deprecated-declarations -Wno-missing-braces -Wno-overloaded-virtual -std=c++17 -fPIC -fPIE -fstack-protector-strong -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -fno-rtti -fno-exceptions -Wno-unused-private-field -O2 -DNDEBUG -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -s -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,libmindspore-lite.so -o libmindspore-lite.so @CMakeFiles/mindspore-lite.dir/objects1.rsp -llog -ldl -latomic -lm @@ -99,12 +99,12 @@ Refer to the example steps below. 4. Modify the command, replace the object to be compiled, and compile the cropped static library into a dynamic library. - Take the above print command as an example to find the object `@CMakeFiles/mindspore-lite.dir/objects1.rsp` to be compiled in the command, replace with the cropped static library object `-Wl,--whole-archive ./libmindspore-lite.a -Wl,--no-whole-archive`, Where `./libmindspore-lite.a` is the cropped static library path. You can replace it with the path of your own library. The modified command is as follows. + Take the above print command as an example to find the object `@CMakeFiles/mindspore-lite.dir/objects1.rsp` to be compiled in the command, replace it with the cropped static library object `-Wl,--whole-archive ./libmindspore-lite.a -Wl,--no-whole-archive`, where `./libmindspore-lite.a` is the cropped static library path. You can replace it with the path of your own library. The modified command is as follows. ```bash /home/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=/home/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC -D_FORTIFY_SOURCE=2 -O2 -Wall -Werror -Wno-attributes -Wno-deprecated-declarations -Wno-missing-braces -Wno-overloaded-virtual -std=c++17 -fPIC -fPIE -fstack-protector-strong -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -fno-rtti -fno-exceptions -Wno-unused-private-field -O2 -DNDEBUG -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -s -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,libmindspore-lite.so -o libmindspore-lite.so -Wl,--whole-archive ./libmindspore-lite.a -Wl,--no-whole-archive -llog -ldl -latomic -lm ``` - Use this command to compile the clipped static library into a dynamic library and generate `libminspore-lite.so` in the current directory. + Use this command to compile the clipped static library into a dynamic library and generate `libmindspore-lite.so` in the current directory. > - In the command example, `-static-libstdc++` indicates the integration of static STD library. You can delete the command and link the dynamic STD library instead to reduce the package size. diff --git a/docs/lite/docs/source_en/tools/obfuscator_tool.md b/docs/lite/docs/source_en/tools/obfuscator_tool.md index 386c45729be0b4e7b507617cc37782c2b2a0677c..c16918379953970df10356f5e1cd19a474de422a 100644 --- a/docs/lite/docs/source_en/tools/obfuscator_tool.md +++ b/docs/lite/docs/source_en/tools/obfuscator_tool.md @@ -36,7 +36,7 @@ The following describes the parameters in detail. | `--outputFile=` | Yes| Specifies the path of the output model. You do not need to add a suffix because the suffix `.ms` is automatically generated.| - | - | | `--obfDegree=` | No| Sets the obfuscation degree of the model. A larger value indicates that more nodes and edges are added to the model.| \(0,1]| 0.2 | -> - The `.ms` model can be input. +> - The `.ms` model can be used as input. > - The parameter name and value are separated by an equal sign (=) and no space is allowed between them. > - Model obfuscation increases the model scale. A larger value of obfDegree indicates a larger model scale. @@ -46,7 +46,7 @@ The following examples describe how to use the obfuscation command. - Set the log display level to INFO. - ```bat + ```bash set GLOG_v=1 ``` diff --git a/docs/lite/docs/source_en/train/converter_train.md b/docs/lite/docs/source_en/train/converter_train.md index d6fb223a3c892531e5d91aa33f3eb19b7f093d7a..dcb4eda6812373b2a9ee26ad25e41f7bc36d89ae 100644 --- a/docs/lite/docs/source_en/train/converter_train.md +++ b/docs/lite/docs/source_en/train/converter_train.md @@ -4,16 +4,16 @@ ## Overview -Creating your MindSpore Lite(Train on Device) model is a two step procedure: +Creating your MindSpore Lite (Train on Device) model is a two-step procedure: - In the first step, create a network model based on the MindSpore architecture using Python and export it as a `.mindir` file. See [saving model](https://www.mindspore.cn/tutorials/en/master/beginner/save_load.html#saving-and-loading-mindir) in the cloud. -- In the seconde step, this `.mindir` model is converted into a `.ms` format that can be loaded onto an embedded device and can be trained using the MindSpore Lite framework. +- In the second step, this `.mindir` model is converted into a `.ms` format that can be loaded onto an embedded device and can be trained using the MindSpore Lite framework. ## Linux Environment ### Environment Preparation -MindSpore Lite model transfer tool (only suppot Linux OS) has provided multiple parameters. The procedure is as follows: +MindSpore Lite model transfer tool (only support Linux OS) has provided multiple parameters. The procedure is as follows: - [Compile](https://www.mindspore.cn/lite/docs/en/master/build/build.html) or [download](https://www.mindspore.cn/lite/docs/en/master/use/downloads.html) model transfer tool. - Add the path of dynamic library required by the conversion tool to the environment variables LD_LIBRARY_PATH. diff --git a/docs/lite/docs/source_en/train/runtime_train_cpp.md b/docs/lite/docs/source_en/train/runtime_train_cpp.md index dc14681b3ab3f0545fc80a88797b6ee3ea86b3ae..024c2a030844e23e4c7c8b1e554da779ed06f2b4 100644 --- a/docs/lite/docs/source_en/train/runtime_train_cpp.md +++ b/docs/lite/docs/source_en/train/runtime_train_cpp.md @@ -4,13 +4,13 @@ ## Overview -The principal procedures of lite training is as follows: +The principal procedures of lite training are as follows: 1. Design the network and export the `MindIR` model file by using the cloud side APIs. 2. Transfer the `MindIR` file to `ms` model file. 3. Train, evaluate and save `ms` model files. -> The model structure is saved in the transferred `ms` model file which will be load to the device platform for training. +> The model structure is saved in the transferred `ms` model file which will be loaded to the device platform for training. The following figure shows the detailed training process: @@ -38,7 +38,7 @@ User can create the object of the class `Model` by using the function `Build` to `Status Build(GraphCell graph, const std::shared_ptr &model_context = nullptr, const std::shared_ptr &train_cfg = nullptr);` -The following codes show ho to create a training session based on the multi-threads CPU by using the class `Model`. +The following codes show how to create a training session based on the multi-threads CPU by using the class `Model`. ```cpp int CreateSession() { @@ -75,11 +75,11 @@ int CreateSession() { ### Data Reading Pipeline -The class `Dataset` and its extension class (e.g., `MnistDataset` and `AlbumDataset`) have provided abundant data procssing API. Users only need to specify the dataset path and set the data processing operations for the model training by using the shared pointers from the related API. Reading pipeline will decode and load dataset during model training. Refer to [Dataset](https://www.mindspore.cn/lite/api/en/master/api_cpp/mindspore_dataset.html) for more detials. +The class `Dataset` and its extension class (e.g., `MnistDataset` and `AlbumDataset`) have provided abundant data processing API. Users only need to specify the dataset path and set the data processing operations for the model training by using the shared pointers from the related API. Reading pipeline will decode and load dataset during model training. Refer to [Dataset](https://www.mindspore.cn/lite/api/en/master/api_cpp/mindspore_dataset.html) for more details. ### Data Preprocessing Pipeline -The class `TensorTransform` has provided abundant data preprocssing API and has the same function as the cloud side, (e.g., Dimension reshaping, data type casting and one-hot coding). The users only need to create the objects of the extension classes of `TensorTransform` and transfer them to the function `Map`. Refer to [Vision](https://www.mindspore.cn/lite/api/en/master/api_cpp/mindspore_dataset_vision.html) for more detials. +The class `TensorTransform` has provided abundant data preprocessing API and has the same function as the cloud side, (e.g., Dimension reshaping, data type casting and one-hot coding). The users only need to create the objects of the extension classes of `TensorTransform` and transfer them to the function `Map`. Refer to [Vision](https://www.mindspore.cn/lite/api/en/master/api_cpp/mindspore_dataset_vision.html) for more details. ### Example @@ -116,7 +116,7 @@ MindSpore Lite has provided some off-the-shelf callback classes for users (e.g., ### Training -Create the objects of the off-the-shelf functions and call the `Train` function of the class `Model` to training: +Create the objects of the off-the-shelf functions and call the `Train` function of the class `Model` for training: ```cpp int Train() { @@ -259,7 +259,7 @@ MindSpore Lite provides the following methods to obtain model input tensors: /// \brief Obtains the number of elements of the MSTensor. /// /// \return The number of elements of the MSTensor. - int64_t ElementNum() const; + int64_t ElementsNum() const; /// \brief Obtains the data type of the MSTensor. /// @@ -300,7 +300,7 @@ MindSpore Lite provides the following methods to obtain model input tensors: // and assuming label_ptr is a pointer to a batch of label indices (obtained by the DataLoder) auto *in_data = inputs.at(data_index)->MutableData(); auto *in_labels = inputs.at(label_index)->MutableData(); - if ((in_data == nullptr)|| (in_labels == nullptr)) { + if ((in_data == nullptr) || (in_labels == nullptr)) { std::cerr << "Model's input tensor is nullptr" << std::endl; return -1; } @@ -312,7 +312,7 @@ MindSpore Lite provides the following methods to obtain model input tensors: ``` > - The data layout in the model input tensors of MindSpore Lite must be NHWC (batch size, height, weight and channel). - > - The Tensors returned by `GetInputs` and `GetInputByTensorName` methods shuold not be released by users. + > - The Tensors returned by `GetInputs` and `GetInputByTensorName` methods should not be released by users. ### Obtaining Output Tensors @@ -381,7 +381,7 @@ MindSpore Lite provides the following methods to obtain the model's output `MSTe /// \brief Obtains the number of elements of the MSTensor. /// /// \return The number of elements of the MSTensor. - int64_t ElementNum() const; + int64_t ElementsNum() const; /// \brief Obtains the data type of the MSTensor. /// @@ -401,7 +401,7 @@ MindSpore Lite provides the following methods to obtain the model's output `MSTe auto out_tensors = model->GetOutputs(); for (auto out_tensor : out_tensors) { std::cout << "tensor name is:" << out_tensor.Name() << " tensor size is:" << out_tensor.DataSize() - << " tensor elements num is:" << out_tensor.ElementNum() << std::endl; + << " tensor elements num is:" << out_tensor.ElementsNum() << std::endl; // The model output data is float 32. if (out_tensor.DataType() != mindspore::DataType::kNumberTypeFloat32) { std::cerr << "Output should in float32" << std::endl; @@ -413,7 +413,7 @@ MindSpore Lite provides the following methods to obtain the model's output `MSTe return -1; } std::cout << "output data is:"; - for (int i = 0; i < out_tensor.ElementNum() && i < 10; i++) { + for (int i = 0; i < out_tensor.ElementsNum() && i < 10; i++) { std::cout << out_data[i] << " "; } std::cout << std::endl; @@ -486,4 +486,4 @@ The function `Serialization` calls the function `ExportModel` actually. The `Exp You can load the saved model to perform training or inference. -> Please use [benchmark_train](https://www.mindspore.cn/lite/docs/en/master/tools/benchmark_train_tool.html) to measure the performance and accuarcy of the trained models. +> Please use [benchmark_train](https://www.mindspore.cn/lite/docs/en/master/tools/benchmark_train_tool.html) to measure the performance and accuracy of the trained models. diff --git a/docs/lite/docs/source_en/train/runtime_train_java.md b/docs/lite/docs/source_en/train/runtime_train_java.md index 0df748ecb136daef70edc721ae4ab63613a27935..d1ea90a8fa6f32c5be3d81ccaa88b14b9d3fd66f 100644 --- a/docs/lite/docs/source_en/train/runtime_train_java.md +++ b/docs/lite/docs/source_en/train/runtime_train_java.md @@ -16,7 +16,7 @@ The following figure shows the detailed training process: ![img](../images/side_train_sequence_unify_api.png) -> For more javaAPI description, please refer to [API Documentation](https://www.mindspore.cn/lite/api/en/master/index.html). +> For more java API description, please refer to [API Documentation](https://www.mindspore.cn/lite/api/en/master/index.html). ## Model Creating, Loading and Building @@ -87,13 +87,13 @@ The following codes shows the Mnist data reading and data preprocessing process: } } - DataLabelTuple data_label_tupel = new DataLabelTuple(); - data_label_tupel.data = hwc_bin_image; - data_label_tupel.label = labels[i]; - dataset.add(data_label_tupel); + DataLabelTuple data_label_tuple = new DataLabelTuple(); + data_label_tuple.data = hwc_bin_image; + data_label_tuple.label = labels[i]; + dataset.add(data_label_tuple); } } catch (IOException e) { - System.err.println("Read Dateset exception"); + System.err.println("Read Dataset exception"); } } ``` @@ -267,11 +267,11 @@ MindSpore Lite provides the `export` interface to save the model, the prototype * * @param fileName Name Model file name. * @param quantizationType The quant type.0,no_quant,1,weight_quant,2,full_quant. - * @param isOnlyExportInfer if export only inferece. + * @param isOnlyExportInfer if export only inference. * @param outputTensorNames tensor name used for export inference graph. * @return Whether the export is successful. */ - public boolean export(String fileName, int quantizationType, boolean isOnlyExportInfer,List outputTensorNames); + public boolean export(String fileName, int quantizationType, boolean isOnlyExportInfer, List outputTensorNames); ``` You can load the saved model to perform training or inference. diff --git a/docs/lite/docs/source_en/train/train_lenet.md b/docs/lite/docs/source_en/train/train_lenet.md index e9dd3df895f957c42cbe579764f909f6ccd8d997..5b27feccf80f63e5adf0c59c1975ef99a757d957 100644 --- a/docs/lite/docs/source_en/train/train_lenet.md +++ b/docs/lite/docs/source_en/train/train_lenet.md @@ -6,7 +6,7 @@ ## Overview -This tutorial is based on [LeNet training example code](https://gitee.com/mindspore/mindspore-lite/tree/master/mindspore-lite/examples/train_lenet_cpp) and demonstrates training a LeNet on an Android device . +This tutorial is based on [LeNet training example code](https://gitee.com/mindspore/mindspore-lite/tree/master/mindspore-lite/examples/train_lenet_cpp) and demonstrates training a LeNet on an Android device. The completed training procedure is as follows: @@ -70,8 +70,7 @@ cd ./mindspore-lite The `mindspore-lite/examples/train_lenet_cpp` directory relative to the MindSpore Lite source code contains this demo's source code. The version is consistent with that of [MindSpore Lite Download Page](https://www.mindspore.cn/lite/docs/en/master/use/downloads.html) below. If -b the master is specified, you need to obtain the corresponding installation package through [compile from source](https://www.mindspore.cn/lite/docs/en/master/build/build.html). -Go to the [MindSpore Lite Download Page](https://www.mindspore.cn/lite/docs/en/master/use/downloads.html) to download the mindspore-lite-{version}-linux-x64.tar.gz and mindspore-lite-{version}-android-aarch64.tar.gz. The mindspore-lite-{version}-linux-x64.tar.gz is the MindSpore Lite install package for x86 platform, it contains the converter tool `converter_lite`, this demo uses it to converte `MIDIR` model to `.ms` which is supported by MindSpore Lite; The mindspore-lite-{version}-android-aarch64.tar.gz is the MindSpore Lite install package for Android, it contains training runtime library `libmindspore-lite.so`, this demo uses it to train model. Then put the files to the `output` directory relative to MindSpore Lite source code (if there is no `output` directory, you should create it). - +Go to the [MindSpore Lite Download Page](https://www.mindspore.cn/lite/docs/en/master/use/downloads.html) to download the mindspore-lite-{version}-linux-x64.tar.gz and mindspore-lite-{version}-android-aarch64.tar.gz. The mindspore-lite-{version}-linux-x64.tar.gz is the MindSpore Lite install package for x86 platform, it contains the converter tool `converter_lite`, this demo uses it to converte `MINDIR` model to `.ms` which is supported by MindSpore Lite; The mindspore-lite-{version}-android-aarch64.tar.gz is the MindSpore Lite install package for Android, it contains training runtime library `libmindspore-lite.so`, this demo uses it to train model. Then put the files to the `output` directory relative to MindSpore Lite source code (if there is no `output` directory, you should create it). Suppose these packags are downloaded in `/Downloads` directory, `Linux` commands for operations above is as follows: ```bash diff --git a/docs/lite/docs/source_en/train/train_lenet_java.md b/docs/lite/docs/source_en/train/train_lenet_java.md index 859dc8c39f9ae855a1527bf74432af5b2c7b0aed..05e3a669eadefb40f3795f8fa9f7af1431869ce5 100644 --- a/docs/lite/docs/source_en/train/train_lenet_java.md +++ b/docs/lite/docs/source_en/train/train_lenet_java.md @@ -10,7 +10,7 @@ This tutorial demonstrates how to use the Java API on MindSpore Lite by building ### Environment Requirements -- System environment: Linux x86_64 (Ubuntu 18.04.02 LTS is recommended.) +- System environment: Linux x86_64 (Ubuntu 18.04.02 LTS is recommended) - Software dependencies @@ -30,7 +30,8 @@ cd mindspore-lite bash build.sh -I x86_64 -j8 ``` -Environment requirements and settings about the build, see [Building MindSpore Lite](https://www.mindspore.cn/lite/docs/en/master/build/build.html). +For environment requirements and settings about the build, see [Building MindSpore Lite](https://www.mindspore.cn/lite/docs/en/master/build/build.html). + The sample source code used in this tutorial is in the `mindspore-lite/examples/train_lenet_java` directory. ### Downloading the Dataset @@ -144,7 +145,7 @@ For details about how to use Java APIs, visit `,例如 ``` - ./converter_lite --fmk=ModelType --modelFile=ModelFilePath --outputFile=ConvertedModelPath --configFile=/mindspore-lite/tools/converter/quantizer/config/full_quant.cfg --inputShape=intput_1:1,224,224,3;intput_2:1,48; + ./converter_lite --fmk=ModelType --modelFile=ModelFilePath --outputFile=ConvertedModelPath --configFile=/mindspore-lite/tools/converter/quantizer/config/full_quant.cfg --inputShape=input_1:1,224,224,3;input_2:1,48; ``` 2. 针对多Batch的模型,需要无法直接使用数据预处理的功能,用户需要提前预处理矫正数据集,然后以`BIN`的形式设置校准数据集。 diff --git a/docs/lite/docs/source_zh_cn/reference/image_classification_lite.md b/docs/lite/docs/source_zh_cn/reference/image_classification_lite.md index 97d80165c36881f8c3a98dd645af2364ee9149b8..d050efad16163e2fa5b651bffd3474f2b77e51cb 100644 --- a/docs/lite/docs/source_zh_cn/reference/image_classification_lite.md +++ b/docs/lite/docs/source_zh_cn/reference/image_classification_lite.md @@ -21,7 +21,7 @@ 下表是使用MindSpore Lite推理的部分图像分类模型的数据。 -> 下表的性能是在mate30手机上测试的。 +> 下表的性能是在Mate30手机上测试的。 | 模型名称 | 大小(Mb) | Top1 | Top5 | F1 | CPU 4线程时延(ms) | |-----------------------| :----------: | :----------: | :----------: | :----------: | :-----------: | diff --git a/docs/lite/docs/source_zh_cn/reference/image_segmentation_lite.md b/docs/lite/docs/source_zh_cn/reference/image_segmentation_lite.md index a4a7d8d6de15b9cfb922344f8ab06166ac9b562f..6f5aecf10c70af7f821f7cb62bf96d5e1c0a5343 100644 --- a/docs/lite/docs/source_zh_cn/reference/image_segmentation_lite.md +++ b/docs/lite/docs/source_zh_cn/reference/image_segmentation_lite.md @@ -12,7 +12,7 @@ 下表是使用MindSpore Lite推理的部分图像分割模型的数据。 -> 下表的性能是在mate30手机上测试的。 +> 下表的性能是在Mate30手机上测试的。 | 模型名称 | 大小(Mb) | IoU | CPU 4线程时延(ms) | |-----------------------| :------: | :-------: | :------: | diff --git a/docs/lite/docs/source_zh_cn/reference/object_detection_lite.md b/docs/lite/docs/source_zh_cn/reference/object_detection_lite.md index b028bf579e993b0da4c0d290a7f0198c354d3d5f..5be8dab86c35ae68b858dc4d1f851787fca14c3c 100644 --- a/docs/lite/docs/source_zh_cn/reference/object_detection_lite.md +++ b/docs/lite/docs/source_zh_cn/reference/object_detection_lite.md @@ -18,7 +18,7 @@ 下表是使用MindSpore Lite推理的部分目标检测模型的数据。 -> 下表的性能是在mate30手机上测试的。 +> 下表的性能是在Mate30手机上测试的。 | 模型名称 | 大小(Mb) | mAP(IoU=0.50:0.95) | CPU 4线程时延(ms) | |-----------------------| :----------: | :----------: | :-----------: | diff --git a/docs/lite/docs/source_zh_cn/reference/operator_list_lite_for_onnx.md b/docs/lite/docs/source_zh_cn/reference/operator_list_lite_for_onnx.md index 8db64613c5bd039aa4ab2b2dc3f885a912eac8a7..597a3d1f2345bec12aa9e86943fc674a4b37ef69 100644 --- a/docs/lite/docs/source_zh_cn/reference/operator_list_lite_for_onnx.md +++ b/docs/lite/docs/source_zh_cn/reference/operator_list_lite_for_onnx.md @@ -38,7 +38,6 @@ | Flatten | 数据按维度展开 | Flatten | 不支持uint8类型。 | | Floor | 向下取整 | Floor | - | | FusedBatchNorm | 对输入做标准化 | BatchNormalization | - | -| GatherNd | 根据索引张量从输入张量中收集指定位置的元素 | GatherND | - | | Gather | 沿单一维度收集指定索引位置的元素 | Gather | 不支持uint8类型。不支持QuantType_QUANT_NONE量化类型。 | | GatherD | 将输入tensor中的元素根据索引tensor进行收集 | GatherElements | - | | GatherNd | 将输入张量的切片聚合成具有indices指定维度的新张量 | GatherND | - | @@ -47,7 +46,6 @@ | InstanceNorm | 实例归一化 | InstanceNormalization | - | | LeakyReLU | 带泄漏的 ReLU激活函数,对负输入给予微小斜率 | LeakyRelu | - | | Less | 逐元素比较两个张量,返回 A < B的逻辑结果。 | Less | - | -| LRN | 局部响应归一化 | Lrn、LRN | - | | Log | 逐元素求对数 | Log | 不支持负数输入。 | | LogicalAnd | 逐元素逻辑与(AND)运算 | And | - | | LogicalNot | 元素级逻辑非运算 | Not | - | diff --git a/docs/lite/docs/source_zh_cn/tools/benchmark_tool.md b/docs/lite/docs/source_zh_cn/tools/benchmark_tool.md index ef80730583132a48d51db8d0e1c27b738c3b58f7..df2495df6251b990ff64296faad11abb78d1cb9f 100644 --- a/docs/lite/docs/source_zh_cn/tools/benchmark_tool.md +++ b/docs/lite/docs/source_zh_cn/tools/benchmark_tool.md @@ -116,11 +116,11 @@ Model = model.ms, numThreads = 2, MinRunTime = 72.228996 ms, MaxRuntime = 73.094 ./benchmark --modelFile=/path/to/model.ms --timeProfiling=true ``` -这条命令使用随机输入,并且输出模型网络层的耗时信息,其他参数使用默认值。该命令执行后,模型网络层的耗时会输出如下统计信息,在该例中,该统计信息按照`opName`和`optype`两种划分方式分别显示,`opName`表示算子名,`optype`表示算子类别,`avg`表示该算子的平均单次运行时间,`percent`表示该算子运行耗时占所有算子运行总耗时的比例,`calledTimess`表示该算子的运行次数,`opTotalTime`表示该算子运行指定次数的总耗时。最后,`total time`和`kernel cost`分别显示了该模型单次推理的平均耗时和模型推理中所有算子的平均耗时之和。 +这条命令使用随机输入,并且输出模型网络层的耗时信息,其他参数使用默认值。该命令执行后,模型网络层的耗时会输出如下统计信息,在该例中,该统计信息按照`opName`和`optype`两种划分方式分别显示,`opName`表示算子名,`optype`表示算子类别,`avg`表示该算子的平均单次运行时间,`percent`表示该算子运行耗时占所有算子运行总耗时的比例,`calledTimes`表示该算子的运行次数,`opTotalTime`表示该算子运行指定次数的总耗时。最后,`total time`和`kernel cost`分别显示了该模型单次推理的平均耗时和模型推理中所有算子的平均耗时之和。 ```text ----------------------------------------------------------------------------------------- -opName avg(ms) percent calledTimess opTotalTime +opName avg(ms) percent calledTimes opTotalTime conv2d_1/convolution 2.264800 0.824012 10 22.648003 conv2d_2/convolution 0.223700 0.081390 10 2.237000 dense_1/BiasAdd 0.007500 0.002729 10 0.075000 @@ -138,7 +138,7 @@ reshape_1/Reshape/shape 0.009900 reshape_1/Shape 0.002300 0.000837 10 0.023000 reshape_1/strided_slice 0.009700 0.003529 10 0.097000 ----------------------------------------------------------------------------------------- -opType avg(ms) percent calledTimess opTotalTime +opType avg(ms) percent calledTimes opTotalTime Activation 0.006900 0.002510 10 0.069000 BiasAdd 0.012800 0.004657 20 0.128000 Conv2D 2.488500 0.905401 20 24.885004 diff --git a/docs/lite/docs/source_zh_cn/tools/benchmark_train_tool.md b/docs/lite/docs/source_zh_cn/tools/benchmark_train_tool.md index 09d13dd088aaeea1f290639157f478e095f4d57e..e2813d8d7a6fd23831d51be2c7d088134a745c57 100644 --- a/docs/lite/docs/source_zh_cn/tools/benchmark_train_tool.md +++ b/docs/lite/docs/source_zh_cn/tools/benchmark_train_tool.md @@ -72,11 +72,11 @@ Model = test_benchmark.ms, numThreads = 1, MinRunTime = 72.228996 ms, MaxRuntime ./benchmark_train --modelFile=./models/test_benchmark.ms --epochs=10 --timeProfiling=true ``` -这条命令使用随机输入,并且输出模型网络层的耗时信息,其他参数使用默认值。该命令执行后,模型网络层的耗时会输出如下统计信息,在该例中,该统计信息按照`opName`和`optype`两种划分方式分别显示,`opName`表示算子名,`optype`表示算子类别,`avg`表示该算子的平均单次运行时间,`percent`表示该算子运行耗时占所有算子运行总耗时的比例,`calledTimess`表示该算子的运行次数,`opTotalTime`表示该算子运行指定次数的总耗时。最后,`total time`和`kernel cost`分别显示了该模型单次推理的平均耗时和模型推理中所有算子的平均耗时之和。 +这条命令使用随机输入,并且输出模型网络层的耗时信息,其他参数使用默认值。该命令执行后,模型网络层的耗时会输出如下统计信息,在该例中,该统计信息按照`opName`和`optype`两种划分方式分别显示,`opName`表示算子名,`optype`表示算子类别,`avg`表示该算子的平均单次运行时间,`percent`表示该算子运行耗时占所有算子运行总耗时的比例,`calledTimes`表示该算子的运行次数,`opTotalTime`表示该算子运行指定次数的总耗时。最后,`total time`和`kernel cost`分别显示了该模型单次推理的平均耗时和模型推理中所有算子的平均耗时之和。 ```text ----------------------------------------------------------------------------------------- -opName avg(ms) percent calledTimess opTotalTime +opName avg(ms) percent calledTimes opTotalTime conv2d_1/convolution 2.264800 0.824012 10 22.648003 conv2d_2/convolution 0.223700 0.081390 10 2.237000 dense_1/BiasAdd 0.007500 0.002729 10 0.075000 @@ -94,7 +94,7 @@ reshape_1/Reshape/shape 0.009900 reshape_1/Shape 0.002300 0.000837 10 0.023000 reshape_1/strided_slice 0.009700 0.003529 10 0.097000 ----------------------------------------------------------------------------------------- -opType avg(ms) percent calledTimess opTotalTime +opType avg(ms) percent calledTimes opTotalTime Activation 0.006900 0.002510 10 0.069000 BiasAdd 0.012800 0.004657 20 0.128000 Conv2D 2.488500 0.905401 20 24.885004 diff --git a/docs/lite/docs/source_zh_cn/train/runtime_train_cpp.md b/docs/lite/docs/source_zh_cn/train/runtime_train_cpp.md index 7015e7d88e223b9890311f7334de8dad921b07cc..8c098f52df602c52288ff6df7ec8c241d581c936 100644 --- a/docs/lite/docs/source_zh_cn/train/runtime_train_cpp.md +++ b/docs/lite/docs/source_zh_cn/train/runtime_train_cpp.md @@ -257,7 +257,7 @@ return model->Resize(inputs, new_shapes); /// \brief Obtains the number of elements of the MSTensor. /// /// \return The number of elements of the MSTensor. - int64_t ElementNum() const; + int64_t ElementsNum() const; /// \brief Obtains the data type of the MSTensor. /// @@ -379,7 +379,7 @@ MindSpore Lite提供下列方法来获取模型的输出张量: /// \brief Obtains the number of elements of the MSTensor. /// /// \return The number of elements of the MSTensor. - int64_t ElementNum() const; + int64_t ElementsNum() const; /// \brief Obtains the data type of the MSTensor. /// @@ -399,7 +399,7 @@ MindSpore Lite提供下列方法来获取模型的输出张量: auto out_tensors = model->GetOutputs(); for (auto out_tensor : out_tensors) { std::cout << "tensor name is:" << out_tensor.Name() << " tensor size is:" << out_tensor.DataSize() - << " tensor elements num is:" << out_tensor.ElementNum() << std::endl; + << " tensor elements num is:" << out_tensor.ElementsNum() << std::endl; // The model output data is float 32. if (out_tensor.DataType() != mindspore::DataType::kNumberTypeFloat32) { std::cerr << "Output should in float32" << std::endl; @@ -411,7 +411,7 @@ MindSpore Lite提供下列方法来获取模型的输出张量: return -1; } std::cout << "output data is:"; - for (int i = 0; i < out_tensor.ElementNum() && i < 10; i++) { + for (int i = 0; i < out_tensor.ElementsNum() && i < 10; i++) { std::cout << out_data[i] << " "; } std::cout << std::endl; diff --git a/docs/lite/docs/source_zh_cn/train/runtime_train_java.md b/docs/lite/docs/source_zh_cn/train/runtime_train_java.md index 3556edb27ae98afc20bad443c6de19714b1eb7dc..3cd21521d40b1576cd067b63498046196bb2f370 100644 --- a/docs/lite/docs/source_zh_cn/train/runtime_train_java.md +++ b/docs/lite/docs/source_zh_cn/train/runtime_train_java.md @@ -86,13 +86,13 @@ liteModel.build(g, context, cfg); } } - DataLabelTuple data_label_tupel = new DataLabelTuple(); - data_label_tupel.data = hwc_bin_image; - data_label_tupel.label = labels[i]; - dataset.add(data_label_tupel); + DataLabelTuple data_label_tuple = new DataLabelTuple(); + data_label_tuple.data = hwc_bin_image; + data_label_tuple.label = labels[i]; + dataset.add(data_label_tuple); } } catch (IOException e) { - System.err.println("Read Dateset exception"); + System.err.println("Read Dataset exception"); } } ``` @@ -264,11 +264,11 @@ MindSpore Lite提供了`export`接口用于保存模型,原型如下: * * @param fileName Name Model file name. * @param quantizationType The quant type.0,no_quant,1,weight_quant,2,full_quant. - * @param isOnlyExportInfer if export only inferece. + * @param isOnlyExportInfer if export only inference. * @param outputTensorNames tensor name used for export inference graph. * @return Whether the export is successful. */ - public boolean export(String fileName, int quantizationType, boolean isOnlyExportInfer,List outputTensorNames); + public boolean export(String fileName, int quantizationType, boolean isOnlyExportInfer, List outputTensorNames); ``` 保存的模型可继续用于训练或推理。 diff --git a/docs/lite/docs/source_zh_cn/train/train_lenet_java.md b/docs/lite/docs/source_zh_cn/train/train_lenet_java.md index 0551eaed387e77d6d1c785cf6b6b1bc8885557b0..f4ff42ad2a6d1e7a14e24e6272e1465760f03deb 100644 --- a/docs/lite/docs/source_zh_cn/train/train_lenet_java.md +++ b/docs/lite/docs/source_zh_cn/train/train_lenet_java.md @@ -144,7 +144,7 @@ train_lenet_java 2. 切换为训练模式,循环迭代,训练模型。 ```java - model.setTrainMode(true) + model.setTrainMode(true); float min_loss = 1000; float max_acc = 0; for (int i = 0; i < cycles; i++) { diff --git a/docs/mindearth/docs/source_en/medium-range/graphcast.ipynb b/docs/mindearth/docs/source_en/medium-range/graphcast.ipynb index c48c003fb0d0e5e2f5833389f0028ae950582c06..c68f910c2e91a36199a154b24e4f0914baad6b60 100644 --- a/docs/mindearth/docs/source_en/medium-range/graphcast.ipynb +++ b/docs/mindearth/docs/source_en/medium-range/graphcast.ipynb @@ -25,7 +25,7 @@ "source": [ "## Overview\n", "\n", - "GraphCast is a data-driven global weather forecast model developed by researchers from DeepMind and Google. It provides medium-term forecasts of key global weather indicators with a resolution of 0.25°. Equivalent to a spatial resolution of approximately 25 km x 25 km near the equator and a global grid of 721 x 1440 pixels in size. Compared with the previous MachineLearning-based weather forecast model, this model improves the accuarcy to 99.2% of the 252 targets.\n", + "GraphCast is a data-driven global weather forecast model developed by researchers from DeepMind and Google. It provides medium-term forecasts of key global weather indicators with a resolution of 0.25°. Equivalent to a spatial resolution of approximately 25 km x 25 km near the equator and a global grid of 721 x 1440 pixels in size. Compared with the previous MachineLearning-based weather forecast model, this model improves the accuracy to 99.2% of the 252 targets.\n", "\n", "This tutorial introduces the research background and technical path of GraphCast, and shows how to train and fast infer the model through MindSpore Earth. More information can be found in [paper](https://arxiv.org/abs/2212.12794). A partial dataset with a resolution of 1.4° is used in this tutorial and the results are shown below." ]