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

Adding an extra Custom Attribute to an existing operator #18111

Closed
adityat77 opened this issue Oct 26, 2023 · 5 comments
Closed

Adding an extra Custom Attribute to an existing operator #18111

adityat77 opened this issue Oct 26, 2023 · 5 comments
Labels
platform:windows issues related to the Windows platform

Comments

@adityat77
Copy link

adityat77 commented Oct 26, 2023

Describe the issue

I want to latch an extra attribute to each node of a simple MNIST ONNX model.
I'm able to add custom attributes and save the model. However, while loading the model for Inference, I'm getting this:
**Error Unrecognized attribute: CustomAttr for operator Conv**

I've attached a link for the model for reference.

https://drive.google.com/file/d/1votf5NdwU2YHamhCsyrEDi3nkSCBPBjZ/view?usp=sharing

To reproduce

Load the model using this:

onnxruntime.InferenceSession("model.onnx")

Urgency

No response

Platform

Linux

OS Version

4.18.0

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

1.16.1

ONNX Runtime API

Python

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

@github-actions github-actions bot added the platform:windows issues related to the Windows platform label Oct 26, 2023
@adityat77
Copy link
Author

is there a better way to do this / any suggestions are appreciated

@hariharans29
Copy link
Member

hariharans29 commented Oct 26, 2023

The short answer is this can't be done as it violates the ONNX spec/interface for the operators found in the MNIST model. The spec/interface for each operator may be found here. The error you see while loading the mutated model is exactly complaining about this - it doesn't recognize the new attribute as it isn't supported by the spec. Is there any reason why you need to add a custom attribute to every node in the model ?

@adityat77
Copy link
Author

i'm trying to write an e2e application with onnxruntime ir.
will explore alternatives, thanks.

@pranavsharma
Copy link
Contributor

What do you plan to do with the custom attribute? What's your use case?

@hariharans29
Copy link
Member

Please re-open the issue with more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants