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

Model returned by the select_model_inputs_outputs() fails onnx.checker.check_model() #1149

Open
TrigonaMinima opened this issue Dec 25, 2024 · 1 comment

Comments

@TrigonaMinima
Copy link

TrigonaMinima commented Dec 25, 2024

The model created after the use of select_model_inputs_outputs as described on Select outputs fails the onnx.checker.check_model check.

I get the following error:

File .../site-packages/onnx/checker.py:179, in check_model(model, full_check, skip_opset_compatibility_check, check_custom_domain)
    175 if sys.getsizeof(protobuf_string) > MAXIMUM_PROTOBUF:
    176     raise ValueError(
    177         "This protobuf of onnx model is too large (>2GB). Call check_model with model path instead."
    178     )
--> 179 C.check_model(
    180     protobuf_string,
    181     full_check,
    182     skip_opset_compatibility_check,
    183     check_custom_domain,
    184 )

ValidationError: Field 'type' of 'value_info' is required but missing.

Looking at the graph, before-after of the relevant section is as follows:

before

  output {
    name: "probabilities"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
          }
          dim {
            dim_value: 3
          }
        }
      }
    }
  }

after

  output {
    name: "probabilities"
  }

Will this have any impact in production when used in a runtime?

@xadupre
Copy link
Collaborator

xadupre commented Jan 8, 2025

output type should not be needed by the runtime. I can be inferred. I probably changed it to avoid setting the wrong type. You should try this function https://onnx.ai/onnx/api/utils.html#extract-model which was introduced in onnx.

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