--input_format

Applicability

Product

Supported (Yes/No)

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Description

Sets the model input format.

See Also

None

Argument

Argument:

  • If the original framework is Caffe, the supported formats include NCHW (default) and ND (any format with N ≤ 4).
  • If the original framework is ONNX, the supported formats include NCHW (default), NCDHW, and ND (any format with N ≤ 4).
  • If the original framework is TensorFlow, the supported formats include NCHW, NHWC (default), ND, NCDHW, and NDHWC.
    • For a TensorFlow model converted using the ONNX model conversion tool, this option is required and the value must be NCHW.
    • If the original model contains an operator with the argument data_format, this option is required and ND is recommended. During model conversion, the format is inferred based on the operator with data_format. If the input data format cannot be determined, ND is recommended.
  • If the original framework is MindSpore, only NCHW is supported. Other values are invalid, but the model will be successfully converted.

Default: NCHW for Caffe, MindSpore, and ONNX; NHWC for TensorFlow

Restrictions:

  • If AIPP is enabled during model conversion, the NHWC input format is required for inference. Any other input format will be forcefully changed into NHWC, which may be different from that specified by --input_format in the atc command.
  • If --insert_op_conf is also included, --input_format must be set to NCHW or NHWC.
  • If the model has multiple inputs, the data formats of the inputs must be the same.

Suggestions and Benefits

None

Example

--input_format=NCHW

Dependencies and Restrictions

None