Model Build

Log in to the development environment as the running user. Use the ATC tool to build an open-source framework network model (such as ONNX and TensorFlow) into a *.om model file.

The ONNX model is used as an example. You must have the read and write permissions on the files specified in the command.

atc --model=$HOME/module/resnet50*.onnx --framework=5 --output=$HOME/module/out/onnx_resnet50 --soc_version=<soc_version> 

Parameters are listed below. For details about the parameter values and restrictions, see Ascend Tensor Compiler (ATC).

  • --model: path of the ResNet-50 model file.
  • --framework: source framework type. 5 indicates ONNX.
  • --output: path of the resnet50.om model file. Record this path for future use during app development.
  • --soc_version: version of the AI processor. Replace <soc_version> with the actual value.

Note:

  • During model conversion, if a message is displayed indicating that some operators are not supported, develop custom operators first by referring to Ascend C Operator Development and then convert the model again.
  • During model conversion, if a message is displayed, indicating that an operator compilation error occurs, but the message cannot help you locate the error, contact technical support. (After obtaining the logs, click here to contact technical support.) You need to set the DUMP_GE_GRAPH and DUMP_GRAPH_LEVEL environment variables, convert your model again, and collect graphs in each phase during model conversion. For details about the environment variables and graphs, see "Reference > Dump Graph Details" in Ascend Tensor Compiler (ATC).