Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/c-bata/go-onnx

Golang binding of ONNX and ONNX-ML.
https://github.com/c-bata/go-onnx

Last synced: 14 days ago
JSON representation

Golang binding of ONNX and ONNX-ML.

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