Skip to content

Commit

Permalink
fix: read the model from the actual onnx model
Browse files Browse the repository at this point in the history
  • Loading branch information
owulveryck committed Mar 22, 2019
1 parent 435d392 commit 7bd95dc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions example/gorgonia/mnist-reader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"flag"
"fmt"
"image"
"io/ioutil"
"log"
"math"
"net/http"

"github.com/disintegration/imaging"
"github.com/owulveryck/onnx-go"
"github.com/owulveryck/onnx-go/internal/examples/mnist"
"github.com/vincent-petithory/dataurl"
"gorgonia.org/gorgonia/node"
gorgonnx "gorgonia.org/gorgonia/onnx"
Expand All @@ -28,12 +28,18 @@ var (
func main() {
port := flag.String("p", "8100", "port to serve on")
directory := flag.String("d", ".", "the directory of static file to host")
onnxModel := flag.String("model", "", "the onnx model to use")
flag.Parse()

graph = gorgonnx.NewGraph()
model = onnx.NewModel(graph)
b := mnist.GetMnist()
err := model.Unmarshal(b)

b, err := ioutil.ReadFile(*onnxModel)
if err != nil {
log.Fatal(err)
}
//b := mnist.GetMnist()
err = model.Unmarshal(b)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 7bd95dc

Please sign in to comment.