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

onnxruntime_go #584

Open
go-dockly opened this issue Dec 4, 2024 · 1 comment
Open

onnxruntime_go #584

go-dockly opened this issue Dec 4, 2024 · 1 comment
Assignees
Labels
help wanted Extra attention is needed

Comments

@go-dockly
Copy link

go-dockly commented Dec 4, 2024

Hey I tried to load your onnx model into
https://github.com/yalue/onnxruntime_go
it is a much simpler onnx wrapper and loading networks is usually straight forward but with the silero vad onnx model something must be off in the way the header is encoded it complains that the shape info is not set:

	onnx.SetSharedLibraryPath(onnxLibPath)
	if err = onnx.InitializeEnvironment(); err != nil {
		return nil, fmt.Errorf("failed to init onnx lib: %w", err)
	}
	inputs, outputs, err := onnx.GetInputOutputInfo(netPath)
	if err != nil {
		return nil, fmt.Errorf("failed to get info for %s: %w", netPath, err)
	}
	for _, i := range inputs {
		fmt.Printf("	%s:%v ->", i.Name, i.Dimensions)
	}
	for _, o := range outputs {
		fmt.Printf("	%s\n", o.Name)
	}
        panic: runtime error: index out of range [0] with length 0
        
        goroutine 36 [running]:
        github.com/yalue/onnxruntime_go.getShapeFromInfo.func2(0x12c2394f0?, {0x1048b7000?, 0x140001bdb28?, 0x104445cd4?}, 0x12c210210?)
                /Users/enigma/go/pkg/mod/github.com/yalue/[email protected]/onnxruntime_go.go:1754 +0x88
        github.com/yalue/onnxruntime_go.getShapeFromInfo(0x12c2394f0)`

Would it be possible to make the network with standard way of encoding model meta data? Unfortunately, I don't know enough of python myself :(

@go-dockly go-dockly added the help wanted Extra attention is needed label Dec 4, 2024
@go-dockly
Copy link
Author

https://github.com/onnx/models/blob/main/validated/vision/object_detection_segmentation/yolov4/dependencies/Conversion.ipynb

Found this example how they encode the onnx model from tflite for yolov4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants