Creating your MindSpore Lite(Train on Device) model is a two step procedure:
.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. The converted .ms
models can be used for both training and inference.MindSpore Lite model transfer tool (only suppot Linux OS) has provided multiple parameters. The procedure is as follows:
Add the path of dynamic library required by the conversion tool to the environment variables LD_LIBRARY_PATH.
export LD_LIBRARY_PATH=${PACKAGE_ROOT_PATH}/tools/converter/lib:${LD_LIBRARY_PATH}
${PACKAGE_ROOT_PATH} is the decompressed package path obtained by compiling or downloading.
The table below shows the parameters used in the MindSpore Lite model training transfer tool.
Parameters | required | Parameter Description | Value Range | Default Value |
---|---|---|---|---|
--help |
no | Prints all the help information. | - | - |
--fmk=<FMK> |
yes | Original format of the input model. | MINDIR | - |
--modelFile=<MODELFILE> |
yes | Path of the input model. | - | - |
--outputFile=<OUTPUTFILE> |
yes | Path of the output model. The suffix .ms can be automatically generated. |
- | - |
--trainModel=true |
no | If the original model is a training model, the value must be true. | true, false | false |
--configFile=<CONFIGFILE> |
No | 1) Configure quantization parameter; 2) Profile path for extension. | - | - |
The parameter name and parameter value are separated by an equal sign (=) and no space is allowed between them.
The calibration dataset configuration file uses the
key=value
mode to define related parameters. For the configuration parameters related to quantization, please refer to post training quantization.
If running the conversion command is failed, an errorcode will be output.
Suppose the file to be converted is my_model.mindir
and run the following command:
./converter_lite --fmk=MINDIR --trainModel=true --modelFile=my_model.mindir --outputFile=my_model
If the command executes successfully, the model.ms
target file will be obtained and the console will print as follows:
CONVERT RESULT SUCCESS:0
If running the conversion command is failed, an errorcode will be output.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。