diff --git a/docs/lite/api/source_zh_cn/api_c/status_c.md b/docs/lite/api/source_zh_cn/api_c/status_c.md new file mode 100644 index 0000000000000000000000000000000000000000..79ba93aae35e49489dd19c8f5eda8c2b9db516ec --- /dev/null +++ b/docs/lite/api/source_zh_cn/api_c/status_c.md @@ -0,0 +1,96 @@ +# status_c + +[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/docs/lite/api/source_zh_cn/api_c/status_c.md) + +```C +#include +``` + +status_c.h提供了MindSpore Lite运行时的状态码。 + +## MSCompCode + +MindSpore不同组件的代码。 + +```C +enum MSCompCode { + kMSCompCodeCore = 0x00000000u, + kMSCompCodeMD = 0x10000000u, + kMSCompCodeME = 0x20000000u, + kMSCompCodeMC = 0x30000000u, + kMSCompCodeLite = 0xF0000000u, +}; +``` + +| 定义 | 值 | 描述 | +| --------------- | ----------- | -------------------------------- | +| kMSCompCodeCore | 0x00000000u | MindSpore Core的代码。 | +| kMSCompCodeMD | 0x10000000u | MindSpore MindData的代码。 | +| kMSCompCodeME | 0x20000000u | MindSpore MindExpression的代码。 | +| kMSCompCodeMC | 0x30000000u | MindSpore的代码。 | +| kMSCompCodeLite | 0xF0000000u | MindSpore Lite的代码。 | + +## MSStatus + +MindSpore的状态码。 + +```C +typedef enum MSStatus { + kMSStatusSuccess = 0, + kMSStatusCoreFailed = kMSCompCodeCore | 0x1, + kMSStatusLiteError = kMSCompCodeLite | (0x0FFFFFFF & -1), + kMSStatusLiteNullptr = kMSCompCodeLite | (0x0FFFFFFF & -2), + kMSStatusLiteParamInvalid = kMSCompCodeLite | (0x0FFFFFFF & -3), + kMSStatusLiteNoChange = kMSCompCodeLite | (0x0FFFFFFF & -4), + kMSStatusLiteSuccessExit = kMSCompCodeLite | (0x0FFFFFFF & -5), + kMSStatusLiteMemoryFailed = kMSCompCodeLite | (0x0FFFFFFF & -6), + kMSStatusLiteNotSupport = kMSCompCodeLite | (0x0FFFFFFF & -7), + kMSStatusLiteThreadPoolError = kMSCompCodeLite | (0x0FFFFFFF & -8), + kMSStatusLiteUninitializedObj = kMSCompCodeLite | (0x0FFFFFFF & -9), + kMSStatusLiteFileError = kMSCompCodeLite | (0x0FFFFFFF & -10), + kMSStatusLiteServiceDeny = kMSCompCodeLite | (0x0FFFFFFF & -11), + kMSStatusLiteModelRebuild = kMSCompCodeLite | (0x0FFFFFFF & -12), + kMSStatusLiteOutOfTensorRange = kMSCompCodeLite | (0x0FFFFFFF & -100), + kMSStatusLiteInputTensorError = kMSCompCodeLite | (0x0FFFFFFF & -101), + kMSStatusLiteReentrantError = kMSCompCodeLite | (0x0FFFFFFF & -102), + kMSStatusLiteGraphFileError = kMSCompCodeLite | (0x0FFFFFFF & -200), + kMSStatusLiteNotFindOp = kMSCompCodeLite | (0x0FFFFFFF & -300), + kMSStatusLiteInvalidOpName = kMSCompCodeLite | (0x0FFFFFFF & -301), + kMSStatusLiteInvalidOpAttr = kMSCompCodeLite | (0x0FFFFFFF & -302), + kMSStatusLiteOpExecuteFailure = kMSCompCodeLite | (0x0FFFFFFF & -303), + kMSStatusLiteFormatError = kMSCompCodeLite | (0x0FFFFFFF & -400), + kMSStatusLiteInferError = kMSCompCodeLite | (0x0FFFFFFF & -500), + kMSStatusLiteInferInvalid = kMSCompCodeLite | (0x0FFFFFFF & -501), + kMSStatusLiteInputParamInvalid = kMSCompCodeLite | (0x0FFFFFFF & -600), +} MSStatus; +``` + +| 定义 | 值 | 描述 | +| ------------------- | --------------- | ---- | +| kMSStatusSuccess | 0 | 通用的成功状态码。 | +| kMSStatusCoreFailed | kMSCompCodeCore \| 0x1 | MindSpore Core 失败状态码。 | +| kMSStatusLiteError | kMSCompCodeLite \| (0x0FFFFFFF & -1) |MindSpore Lite 异常状态码。| +| kMSStatusLiteNullptr | kMSCompCodeLite \| (0x0FFFFFFF & -2) |MindSpore Lite 空指针状态码。| +| kMSStatusLiteParamInvalid | kMSCompCodeLite \| (0x0FFFFFFF & -3) |MindSpore Lite 参数异常状态码。| +| kMSStatusLiteNoChange | kMSCompCodeLite \| (0x0FFFFFFF & -4) |MindSpore Lite 未改变状态码。| +| kMSStatusLiteSuccessExit | kMSCompCodeLite \| (0x0FFFFFFF & -5) |MindSpore Lite 没有错误但是退出的状态码。| +| kMSStatusLiteMemoryFailed | kMSCompCodeLite \| (0x0FFFFFFF & -6) |MindSpore Lite 内存分配失败的状态码。| +| kMSStatusLiteNotSupport | kMSCompCodeLite \| (0x0FFFFFFF & -7) |MindSpore Lite 功能未支持的状态码。| +| kMSStatusLiteThreadPoolError | kMSCompCodeLite \| (0x0FFFFFFF & -8) |MindSpore Lite 线程池异常状态码。| +| kMSStatusLiteUninitializedObj | kMSCompCodeLite \| (0x0FFFFFFF & -9) |MindSpore Lite 未初始化状态码。| +| kMSStatusLiteFileError | kMSCompCodeLite \| (0x0FFFFFFF & -10) |MindSpore Lite 无效文件状态码。| +| kMSStatusLiteServiceDeny | kMSCompCodeLite \| (0x0FFFFFFF & -11) |MindSpore Lite 拒绝服务状态码。| +| kMSStatusLiteModelRebuild | kMSCompCodeLite \| (0x0FFFFFFF & -12) |MindSpore Lite 模型重复构建状态码。| +| kMSStatusLiteOutOfTensorRange | kMSCompCodeLite \| (0x0FFFFFFF & -100) |MindSpore Lite 张量溢出错误的状态码。| +| kMSStatusLiteInputTensorError | kMSCompCodeLite \| (0x0FFFFFFF & -101) |MindSpore Lite 输入张量异常的状态码。| +| kMSStatusLiteReentrantError | kMSCompCodeLite \| (0x0FFFFFFF & -102) |MindSpore Lite 重入异常的状态码。| +| kMSStatusLiteGraphFileError | kMSCompCodeLite \| (0x0FFFFFFF & -200) |MindSpore Lite 文件异常状态码。| +| kMSStatusLiteNotFindOp | kMSCompCodeLite \| (0x0FFFFFFF & -300) |MindSpore Lite 未找到算子的状态码。| +| kMSStatusLiteInvalidOpName | kMSCompCodeLite \| (0x0FFFFFFF & -301) |MindSpore Lite 无效算子状态码。| +| kMSStatusLiteInvalidOpAttr | kMSCompCodeLite \| (0x0FFFFFFF & -302) |MindSpore Lite 无效算子超参数状态码。| +| kMSStatusLiteOpExecuteFailure | kMSCompCodeLite \| (0x0FFFFFFF & -303) |MindSpore Lite 算子执行失败的状态码。| +| kMSStatusLiteFormatError | kMSCompCodeLite \| (0x0FFFFFFF & -400) |MindSpore Lite 张量格式异常状态码。| +| kMSStatusLiteInferError | kMSCompCodeLite \| (0x0FFFFFFF & -500) |MindSpore Lite 形状推理异常状态码。| +| kMSStatusLiteInferInvalid | kMSCompCodeLite \| (0x0FFFFFFF & -501) |MindSpore Lite 无效的形状推理的状态码。| +| kMSStatusLiteInputParamInvalid | kMSCompCodeLite \| (0x0FFFFFFF & -600) |MindSpore Lite 用户输入的参数无效状态码。| + diff --git a/docs/lite/api/source_zh_cn/api_c/types_c.md b/docs/lite/api/source_zh_cn/api_c/types_c.md index 60bd19d91b1a07f0a6d24a695ca67f5de679e1f6..f8fdb2f52391556ef086ecb3dd9981c19b9b12a6 100644 --- a/docs/lite/api/source_zh_cn/api_c/types_c.md +++ b/docs/lite/api/source_zh_cn/api_c/types_c.md @@ -6,7 +6,7 @@ #include ``` -该文的件定义了一些枚举类型的数据类型。 +该文件定义了一些枚举类型的数据类型。 ## MSModelType diff --git a/docs/lite/docs/source_en/build/build.md b/docs/lite/docs/source_en/build/build.md index 44534cb12d34f721081fa651aaa079fd952add03..55ab7bd6f0b065f7c4726dd729dfc5ad1c920f83 100644 --- a/docs/lite/docs/source_en/build/build.md +++ b/docs/lite/docs/source_en/build/build.md @@ -52,15 +52,10 @@ Modules in MindSpore Lite: > Gradle is recommended to use the [gradle-6.6.1-complete](https://gradle.org/next-steps/?version=6.6.1&format=all) version. If you configure other versions, gradle will automatically download `gradle-6.6.1-complete` by gradle wrapper mechanism. > -> You can also directly use the Docker compilation image that has been configured with the above dependencies. -> -> - Download the docker image: `docker pull swr.cn-south-1.myhuaweicloud.com/mindspore-build/mindspore-lite:ubuntu18.04.2-20210530` -> - Create a container: `docker run -tid --net=host --name=docker01 swr.cn-south-1.myhuaweicloud.com/mindspore-build/mindspore-lite:ubuntu18.04.2-20210530` -> - Enter the container: `docker exec -ti -u 0 docker01 bash` ### Compilation Options -The script `build.sh` in the root directory of MindSpore can be used to compile MindSpore Lite. +The script `build.sh` in the root directory of MindSpore Lite can be used to compile MindSpore Lite. #### Instructions for Parameters of `build.sh` @@ -182,7 +177,7 @@ Finally, the following files will be generated in the `output/` directory: - `mindspore-lite-{version}-{python}-{os}-{arch}.whl`: The Whl package which contains runtime (Python). -> - version: Version of the output, consistent with that of the MindSpore. +> - version: Version of the output, consistent with that of the MindSpore Lite. > - python: Python version of the output, for example, Python 3.7 is `cp37-cp37m`. > - os: Operating system on which the output will be deployed. > - arch: System architecture on which the output will be deployed. @@ -294,7 +289,7 @@ After successful installation, you can use the command of `pip show mindspore_li ### Compilation Options -The script `build.bat` in the root directory of MindSpore can be used to compile MindSpore Lite. +The script `build.bat` in the root directory of MindSpore Lite can be used to compile MindSpore Lite. #### The Compilation Parameter of `build.bat` @@ -339,7 +334,7 @@ Finally, the following files will be generated in the `output/` directory: - `mindspore-lite-{version}-win-x64.zip`: Contains model inference framework and related tool. -> version: Version of the output, consistent with that of the MindSpore. +> version: Version of the output, consistent with that of the MindSpore Lite. ### Directory Structure @@ -396,7 +391,7 @@ Finally, the following files will be generated in the `output/` directory: ### Compilation Options -The script `build.sh` in the root directory of MindSpore can be used to compile MindSpore Lite. +The script `build.sh` in the root directory of MindSpore Lite can be used to compile MindSpore Lite. #### The Compilation Parameter of `build.sh` @@ -437,7 +432,7 @@ Finally, the following files will be generated in the `output/` directory: - `mindspore-lite-{version}-{os}-{arch}.tar.gz`: Contains model inference framework. -> - version: Version of the output, consistent with that of the MindSpore. +> - version: Version of the output, consistent with that of the MindSpore Lite. > - os: Operating system on which the output will be deployed. > - arch: System architecture on which the output will be deployed. diff --git a/docs/lite/docs/source_en/quick_start/one_hour_introduction.md b/docs/lite/docs/source_en/quick_start/one_hour_introduction.md index 82430dfee092d0417b4425e9774905f385dad7b9..c30df9a908463225ba6d864575109d5d27bbcfc5 100644 --- a/docs/lite/docs/source_en/quick_start/one_hour_introduction.md +++ b/docs/lite/docs/source_en/quick_start/one_hour_introduction.md @@ -140,7 +140,7 @@ The model conversion procedure is as follows: You can use your own model or click [here](https://download.mindspore.cn/model_zoo/official/lite/quick_start/mobilenetv2.mindir) to download a MindSpore model for testing. Take the downloaded model as an example. Copy the model `mobilenetv2.mindir` to the directory where the converter is located. The model conversion command is as follows: - ```bash + ```bash ./converter_lite --fmk=MINDIR --modelFile=mobilenetv2.mindir --outputFile=mobilenetv2 ``` @@ -914,7 +914,7 @@ The model conversion procedure is as follows: You can use your own model or click [here](https://download.mindspore.cn/model_zoo/official/lite/quick_start/mobilenetv2.mindir) to download a MindSpore model for testing. Take the downloaded model as an example. Copy the model `mobilenetv2.mindir` to the directory where the converter is located. The model conversion command is as follows: - ```bash + ```bash call converter_lite.exe --fmk=MINDIR --modelFile=mobilenetv2.mindir --outputFile=mobilenetv2 ``` @@ -1397,7 +1397,7 @@ In the previous section, the official inference test tool is used to perform the (3) Load the model. - Create a `Model` class object `model`. The `Model` class defines the model in MindSpore for computational graph management. + Create a `Model` class object `model`. The `Model` class defines the model in MindSpore Lite for computational graph management. For details about the `Model` class, see [API](https://www.mindspore.cn/lite/api/en/r2.7.0/generate/classmindspore_Model.html). ```cpp diff --git a/docs/lite/docs/source_zh_cn/build/build.md b/docs/lite/docs/source_zh_cn/build/build.md index 5f213344dc3a2ec613f3ea86558c0277eac47a45..5659f76564c90bd4cae4e4ba9c978b78826c6013 100644 --- a/docs/lite/docs/source_zh_cn/build/build.md +++ b/docs/lite/docs/source_zh_cn/build/build.md @@ -52,15 +52,10 @@ MindSpore Lite包含模块: > Gradle建议采用[gradle-6.6.1-complete](https://gradle.org/next-steps/?version=6.6.1&format=all)版本,配置其他版本gradle将会采用gradle wrapper机制自动下载`gradle-6.6.1-complete`。 > -> 也可直接使用已配置好上述依赖的Docker编译镜像。 -> -> - 下载镜像:`docker pull swr.cn-south-1.myhuaweicloud.com/mindspore-build/mindspore-lite:ubuntu18.04.2-20210530` -> - 创建容器:`docker run -tid --net=host --name=docker01 swr.cn-south-1.myhuaweicloud.com/mindspore-build/mindspore-lite:ubuntu18.04.2-20210530` -> - 进入容器:`docker exec -ti -u 0 docker01 bash` ### 编译选项 -MindSpore根目录下的`build.sh`脚本可用于MindSpore Lite的编译。 +MindSpore Lite根目录下的`build.sh`脚本可用于MindSpore Lite的编译。 #### `build.sh`的参数使用说明 @@ -294,7 +289,7 @@ python -c "import mindspore_lite" ### 编译选项 -MindSpore根目录下的`build.bat`脚本可用于MindSpore Lite的编译。 +MindSpore Lite根目录下的`build.bat`脚本可用于MindSpore Lite的编译。 #### `build.bat`的编译参数 @@ -396,7 +391,7 @@ call build.bat lite 8 ### 编译选项 -MindSpore根目录下的`build.sh`脚本可用于MindSpore Lite的编译。 +MindSpore Lite根目录下的`build.sh`脚本可用于MindSpore Lite的编译。 #### `build.sh`的编译参数 diff --git a/docs/lite/docs/source_zh_cn/quick_start/one_hour_introduction.md b/docs/lite/docs/source_zh_cn/quick_start/one_hour_introduction.md index 4d83b11c19a5f1af1cafe59d95c60f8b1d768990..5d050ee389477c263a170e9ae92a43a6274fac06 100644 --- a/docs/lite/docs/source_zh_cn/quick_start/one_hour_introduction.md +++ b/docs/lite/docs/source_zh_cn/quick_start/one_hour_introduction.md @@ -36,7 +36,7 @@ #### 下载发布件 -用户可在MindSpore官网[下载页面](https://www.mindspore.cn/lite/docs/zh-CN/r2.7.0/use/downloads.html),得到各版本的MindSpore Lite发布件。 +用户可在MindSpore Lite官网[下载页面](https://www.mindspore.cn/lite/docs/zh-CN/r2.7.0/use/downloads.html),得到各版本的MindSpore Lite发布件。 在本例中,我们选择的是软件系统为Linux、底层架构为x86_64的CPU发布件,以1.6.0版本为例,用户可点击此处直接[下载](https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindSpore/lite/release/linux/x86_64/mindspore-lite-1.6.0-linux-x64.tar.gz)。 每个发布件的包结构会有不同,本例中,Linux发布件的包结构如下(随着用户对MindSpore Lite各个功能的学习,我们将逐步讲解发布件中文件的作用,在此处,用户对发布件结构有个简略印象即可): @@ -446,7 +446,7 @@ mindspore-lite-{version}-linux-x64 2. 获得版本发布件 - 用户可通过MindSpore官网,获得MindSpore Lite发布件,点击[此处](https://www.mindspore.cn/lite/docs/zh-CN/r2.7.0/use/downloads.html)查看各版本。 + 用户可通过MindSpore Lite官网,获得MindSpore Lite发布件,点击[此处](https://www.mindspore.cn/lite/docs/zh-CN/r2.7.0/use/downloads.html)查看各版本。 在本例中,仍然采用了和前几节一样的发布件,用于本节集成开发,点击此处可直接[下载](https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindSpore/lite/release/linux/x86_64/mindspore-lite-1.6.0-linux-x64.tar.gz)。 在本节简单的推理集成例子中,需要用到的发布件内容如下: @@ -818,7 +818,7 @@ mindspore-lite-{version}-linux-x64 #### 下载发布件 -用户可在MindSpore官网[下载页面](https://www.mindspore.cn/lite/docs/zh-CN/r2.7.0/use/downloads.html),得到各版本的MindSpore Lite发布件。 +用户可在MindSpore Lite官网[下载页面](https://www.mindspore.cn/lite/docs/zh-CN/r2.7.0/use/downloads.html),得到各版本的MindSpore Lite发布件。 在本例中,我们选择的是软件系统为Windows、底层架构为x86_64的CPU发布件,以1.6.0版本为例,用户可点击此处直接[下载](https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindSpore/lite/release/windows/mindspore-lite-1.6.0-win-x64.zip)。 每个发布件的包结构会有不同。本例中,Windows发布件的包结构如下: @@ -1149,7 +1149,7 @@ mindspore-lite-{version}-win-x64 2. 得到版本发布件 - 用户可通过MindSpore官网,获得MindSpore Lite发布件,点击[此处](https://www.mindspore.cn/lite/docs/zh-CN/r2.7.0/use/downloads.html)查看各版本。 + 用户可通过MindSpore Lite官网,获得MindSpore Lite发布件,点击[此处](https://www.mindspore.cn/lite/docs/zh-CN/r2.7.0/use/downloads.html)查看各版本。 在本例中,仍然采用了和前几节一样的发布件,用于本节集成开发,点击此处可直接[下载](https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindSpore/lite/release/windows/mindspore-lite-1.6.0-win-x64.zip)。 在本节简单的推理集成例子中,需要用到的发布件内容如下: @@ -1397,7 +1397,7 @@ mindspore-lite-{version}-win-x64 (3) 加载模型 - 首先创建一个`Model`类对象`model`,`Model`类定义了MindSpore中的模型,用于计算图管理。 + 首先创建一个`Model`类对象`model`,`Model`类定义了MindSpore Lite中的模型,用于计算图管理。 关于`Model`类的详细说明,可参考[API文档](https://www.mindspore.cn/lite/api/zh-CN/r2.7.0/api_cpp/mindspore.html#model)。 ```cpp