Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement --outputs_as_nchw option to transpose output to from nhwc to nchw #1979

Merged
merged 10 commits into from
Jul 8, 2022

Conversation

hwangdeyu
Copy link
Contributor

@hwangdeyu hwangdeyu commented Jun 24, 2022

fixes #1973 #1986
Add a option to make outputs format nhwc to nchw.
tf2onnx only supports --inputs-as-nchw for specifying input as nchw so far. However, in some cases, such as models loaded by tensorRT or OpenCV DNN, it also needs to force output to nchw.

Signed-off-by: Deyu Huang <[email protected]>
Signed-off-by: Deyu Huang <[email protected]>
Signed-off-by: Deyu Huang <[email protected]>
Signed-off-by: Deyu Huang <[email protected]>
@hwangdeyu hwangdeyu marked this pull request as ready for review July 6, 2022 12:44
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@hwangdeyu hwangdeyu changed the title Add --outputs_as_nchw option to transpose output to from nchw to nhwc Add --outputs_as_nchw option to transpose output to from nhwc to nchw Jul 7, 2022
README.md Outdated Show resolved Hide resolved
Signed-off-by: Deyu Huang <[email protected]>
Copy link
Collaborator

@fatcat-z fatcat-z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@hwangdeyu hwangdeyu enabled auto-merge (squash) July 8, 2022 06:49
Signed-off-by: Deyu Huang <[email protected]>
@hwangdeyu hwangdeyu disabled auto-merge July 8, 2022 07:09
@hwangdeyu hwangdeyu enabled auto-merge (squash) July 8, 2022 07:09
@hwangdeyu hwangdeyu changed the title Add --outputs_as_nchw option to transpose output to from nhwc to nchw Implement --outputs_as_nchw option to transpose output to from nhwc to nchw Jul 8, 2022
@hwangdeyu hwangdeyu merged commit 9ce72be into onnx:main Jul 8, 2022
@hwangdeyu hwangdeyu deleted the output_as_nchw branch July 11, 2022 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force output to have chw layout
2 participants