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

[onnx] Show warning when unused inputs are removed #654

Open
xuzijian629 opened this issue Mar 28, 2023 · 0 comments
Open

[onnx] Show warning when unused inputs are removed #654

xuzijian629 opened this issue Mar 28, 2023 · 0 comments

Comments

@xuzijian629
Copy link
Contributor

xuzijian629 commented Mar 28, 2023

With current behavior, the saved input_0.pb, ..., input_{n-1}.pb input tensors can have different number than the number of model inputs. This may confuse users.

I think removing unnecessary inputs is fine.

used_input_index_list = []
for used_input in onnx_graph.graph.input:
if used_input.name not in initializer_names:
used_input_index_list.append(input_names.index(used_input.name))
input_names = [input_names[i] for i in used_input_index_list]
args = [args[i] for i in used_input_index_list]

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

1 participant