Skip to content

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

@TrigonaMinima

Description

@TrigonaMinima

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?

Metadata

Metadata

Assignees

No one assigned

    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