Skip to content

NHWC to NCHW input NCHW but output NHWC? #1986

@AromaticJ

Description

@AromaticJ

I used command:
python -m tf2onnx.convert --graphdef ./model.pb --output ./model.onnx --inputs input_tensor:0 --inputs-as-nchw input_tensor:0 --outputs output_1:0,output_2:0,output_3:0,output_4:0,output_5:0
converted an onnx file successfully, and used it to generate an tensorrt engine on Nvidia Orin device with tensorrt8 by trtexec tools,
however, trtexec logs:

[10/02/2019-23:59:47] [I] Created input binding for input_tensor:0 with dimensions 1x3x512x512
[10/02/2019-23:59:47] [I] Using random values for output output_0:0
[10/02/2019-23:59:47] [I] Created output binding for output_0:0 with dimensions 1x512x512x3
[10/02/2019-23:59:47] [I] Using random values for output output_1:0
[10/02/2019-23:59:47] [I] Created output binding for output_1:0 with dimensions 1x512x512x3
[10/02/2019-23:59:47] [I] Using random values for output output_2:0
[10/02/2019-23:59:47] [I] Created output binding for output_2:0 with dimensions 1x512x512x3
[10/02/2019-23:59:47] [I] Using random values for output output_3:0
[10/02/2019-23:59:47] [I] Created output binding for output_3:0 with dimensions 1x512x512x3
[10/02/2019-23:59:47] [I] Using random values for output output_4:0
[10/02/2019-23:59:47] [I] Created output binding for output_4:0 with dimensions 1x512x512x3
[10/02/2019-23:59:47] [I] Starting inference

you can see, my input is already format nchw, but outputs are still format nhwc.
How to convert my outputs to format nchw as same as input?

System information

  • OS Ubuntu 18.04:
  • Tensorflow 1.14:
  • Python version 3.6:
  • tensorrt 8.2.1:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions