https://github.com/c-bata/go-onnx
Golang binding of ONNX and ONNX-ML.
https://github.com/c-bata/go-onnx
Last synced: 4 months ago
JSON representation
Golang binding of ONNX and ONNX-ML.
- Host: GitHub
- URL: https://github.com/c-bata/go-onnx
- Owner: c-bata
- License: mit
- Created: 2019-05-22T19:56:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-22T19:56:56.000Z (about 7 years ago)
- Last Synced: 2025-04-04T16:28:25.854Z (about 1 year ago)
- Language: Makefile
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-onnx
Golang binding of ONNX and ONNX-ML.
## Usage
1. Export ONNX-ML IR by using [sklearn-onnx](https://github.com/onnx/sklearn-onnx)
2. Binds it to Go's struct like following code:
```go
package main
import (
"fmt"
"io/ioutil"
"log"
"github.com/c-bata/go-onnx/onnx"
)
func main() {
b, err := ioutil.ReadFile("./rf_iris.onnx")
if err != nil {
log.Fatalln(err)
}
p := &onnx.ModelProto{}
if err := p.XXX_Unmarshal(b); err != nil {
log.Fatalln(err)
}
fmt.Printf("%#v", p)
}
```
## License
MIT License