--insert_op_conf

Applicable Products

  • Ascend 950PR / Ascend 950DT : supported
  • Atlas A3 training products / Atlas A3 inference products : supported
  • Atlas A2 training products / Atlas A2 inference products : supported
  • Atlas 200I/500 A2 inference products : supported
  • Atlas inference products : supported
  • Atlas training products : supported

Description

Sets the configuration file directory (including the file name) of an operator to be inserted, for example, the AIPP operator for data preprocessing.

After this option is used, the input data type must be UINT8.

See Also

Arguments

Argument: Directory (including the name) of the configuration file of the operator to be inserted.

Format: The directory (including the file name) can contain letters, digits, underscores (_), hyphens (-), periods (.), and Chinese characters.

Remarks: The file name extension is not limited to .cfg, but the content in the configuration file must be in .prototxt format.

Suggestions and Benefits

None

Example

The AIPP operator is used as an example, as shown in the following template of the configuration file (insert_op.cfg is assumed as the file name). See AIPP for more details about the configuration file.

aipp_op {
    aipp_mode:static
    input_format:YUV420SP_U8
    csc_switch:true
    var_reci_chn_0:0.00392157
    var_reci_chn_1:0.00392157
    var_reci_chn_2:0.00392157
}

Upload the configured insert_op.cfg file to any directory (for example, $HOME/module) on the server where ATC is located.

--insert_op_conf=$HOME/module/insert_op.cfg

Dependencies and Restrictions

  • When static AIPP is enabled and the dynamic shape range is configured via --input_shape:

    If the model has only one input, this scenario is not supported. If the model has multiple inputs, you must configure different input nodes accordingly, such as setting one input node with static AIPP and another node with a dynamic shape.

  • When static AIPP is enabled and the dynamic image size (unfixed width and height of input images) is configured via --dynamic_image_size:

    The cropping and padding functions cannot be enabled in the AIPP configuration file, and src_image_size_w and src_image_size_h must be set to 0 in the configuration file.

  • When dynamic AIPP is enabled and the dynamic shape range is configured via --input_shape, the width and height of the AIPP-output image must fall within the range configured by --input_shape.
  • When dynamic AIPP is enabled and the dynamic batch size is configured via --dynamic_batch_size:

    During inference, call the aclmdlSetInputAIPP API to set dynamic AIPP parameters. Ensure that batch_size is set to the maximum batch size profile. For details about the API, see aclmdlSetInputAIPP.

  • When dynamic AIPP is enabled and the dynamic image size (unfixed width and height of input images) is configured via --dynamic_image_size:

    During actual inference, call the aclmdlSetInputAIPP API to set dynamic AIPP parameters. Ensure that cropping and padding are disabled. In this scenario, ensure that the width and height configured by calling aclmdlSetInputAIPP are the same as those configured by calling aclmdlSetDynamicHWSize. That is, both values must be set to the width and height of the maximum dynamic image size profile. For details about the APIs, see Model Execution.