How Do I Convert a Single-Operator Description File into an Offline Model?

This section details how to convert a single-operator description file into an offline model.

  1. Construct the single-operator description file by referring to the parameter description in What Is a Single-Operator Description File? and referring to Configuration File Templates. This section describes how to construct an Add operator in ND format, whose single-operator description file is add.json.
  2. Upload the single-operator description file constructed in step 1 as the CANN running user to any directory in the development environment, for example, $HOME/singleop/.
  3. Run the following command (the path and file arguments in the command are for reference only).
    atc --singleop=$HOME/singleop/add.json --output=$HOME/singleop/out/op_model --soc_version=<soc_version>
    • --singleop: specifies the single-operator description file, which is add.json in this example.
    • --output: specifies the directory for storing the generated offline model.
    • --soc_version: AI processor version.

    For details about the options, see Command Line Options.

  4. Check that your model is converted successfully. If the model conversion fails, locate the fault by referring to "Error Codes".
    1
    ATC run success, welcome to the next use.
    

    Find the generated offline model (.om) in the directory specified by the output argument.