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

yolov10 model :operator ConstantOfShape not implemented #218

Open
zhaoyanan2452 opened this issue Sep 3, 2024 · 0 comments
Open

yolov10 model :operator ConstantOfShape not implemented #218

zhaoyanan2452 opened this issue Sep 3, 2024 · 0 comments

Comments

@zhaoyanan2452
Copy link

zhaoyanan2452 commented Sep 3, 2024

Inference result tensor data is 0 value

`package main

import (
"fmt"
"image"
"os"

"github.com/owulveryck/onnx-go"
"github.com/owulveryck/onnx-go/backend/x/gorgonnx"
"gocv.io/x/gocv"
"gorgonia.org/tensor"

)

func main() {
run()

}

func run() {

mfile, _ := os.ReadFile("/home/jetson/onnx-go/yolov10s.onnx")

backend := gorgonnx.NewGraph()

model := onnx.NewModel(backend)

model.UnmarshalBinary(mfile)

mat := gocv.IMRead("/home/jetson/onnx-go/bus.jpg", gocv.IMReadColor)
defer mat.Close()

blob := gocv.BlobFromImage(mat, 1.0/255, image.Point{640, 640}, gocv.NewScalar(0, 0, 0, 0), true, false)

inputdata, _ := blob.DataPtrFloat32()

inputtensor := tensor.New(tensor.Of(tensor.Float32), tensor.WithShape(1, 3, 640, 640), tensor.WithBacking(inputdata))

model.SetInput(0, inputtensor)

backend.Run()

output, _ := model.GetOutputTensors()

a := output[0].Data()

fmt.Println(a.([]float32))

}`

`panic: onnx: operator ConstantOfShape not implemented ()

goroutine 1 [running]:
main.run()
/home/jetson/onnx-go/test1/main.go:54 +0x5b8
main.main()
/home/jetson/onnx-go/test1/main.go:15 +0x1c
exit status 2`

@zhaoyanan2452 zhaoyanan2452 changed the title Onnx model inference by yolov10 yolov10 model :operator ConstantOfShape not implemented Sep 3, 2024
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