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

Can some outputs remain in NCHW format during the conversion, instead of changing to NHWC? #87

Open
surprise2001 opened this issue Nov 4, 2024 · 3 comments

Comments

@surprise2001
Copy link

For example, when I convert a model, the original input shape is [1,1,7680], but after conversion, the shape becomes [1,7680,1]. Although I can initialize the data with the corresponding shape when using the model to perform inference without affecting the results, I still want to know if there's a way to avoid modifying the original shape.

@surprise2001
Copy link
Author

5A2A038B-94F4-4fc2-8431-3B91D2CA9E1D

@surprise2001
Copy link
Author

我有看到有个issues是说了相关的,说是输出之后再转置,那有没有办法就是在做转换的时候就不做那个变换,仍然保持NCHW

@MPolaris
Copy link
Owner

MPolaris commented Nov 5, 2024

I think it's completely feasible, you should make some change at file(utils/graph_tools.py#35, function build_tf_inputs), make input's layout to FORCE_CHANNEL_FIRST_OP.

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

No branches or pull requests

2 participants