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: operator Shape not implemented #219

Open
ShowyQuasar88 opened this issue Sep 12, 2024 · 0 comments
Open

onnx: operator Shape not implemented #219

ShowyQuasar88 opened this issue Sep 12, 2024 · 0 comments

Comments

@ShowyQuasar88
Copy link

I encountered a problem when reading an ONNX model and performing inference. I used gorgonnx as the backend and put it into the model for creation. Then, I performed setInput on the model. A total of three tensors are required, but when executing, an error is reported saying "Operator Shape not implemented". If I'm not mistaken, the Shape operator should have been implemented. But why is this error still reported?
Here is my code
`// Create a backend receiver
backend := gorgonnx.NewGraph()
// Create a model and set the execution backend
model := onnx.NewModel(backend)

f, err := os.ReadFile("onnx/model1.onnx")
if err != nil {
	log.Fatalf("【ERROR】read .onnx file error[%v]", err)
}

if err = model.UnmarshalBinary(f); err != nil {
	log.Fatalf("【ERROR】model unmarshal to binary error[%v]", err)
}

model.SetInput(0, inputs["input_ids"])
model.SetInput(1, inputs["token_type_ids"])
model.SetInput(2, inputs["attention_mask"])

err = backend.Run()
if err != nil {
	log.Fatalf("【ERROR】backend run error[%v]", err)
}`

Very simple, but i really dont know why this error occured
2024/09/12 16:10:05 【ERROR】backend run error[onnx: operator Shape not implemented ()]

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