--input_format
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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 MindSpore, Caffe, and ONNX; NHWC for TensorFlow
Restrictions:
- As model inference only accepts NHWC format data. If AIPP is enabled during model conversion, the input node associated with AIPP will be forced with the NHWC format, 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
Parent topic: Input Options