Code Monkey home page Code Monkey logo

go-onnxruntime's Introduction

go-onnxruntime

Unofficial Go binding for Onnxruntime C++ API. This is used to perform onnx model inference in Go.

Installation

Download and install go-onnxruntime :

go get -v github.com/ivansuteja96/go-onnxruntime

The binding requires Onnxruntime C++ and Go 1.14++.

Onnxruntime C++ Library

The Go binding for Onnxruntime C++ API in this repository is built based on Onnxruntime v1.11.0.

To install Onnxruntime C++ on your system, you can go to onnxruntime and download the assets depends on your system (linux/mac).

The Onnxruntime C++ libraries are expected to be under /usr/local/lib.

The Onnxruntime C++ header files are expected to be under /usrl/local/include.

Configure Environmental Variables

Configure the linker environmental variables since the Onnxruntime C++ library is under a non-system directory. Place the following in either your ~/.bashrc or ~/.zshrc file :

Linux (.bashrc) / macOS (.zshrc)

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

After that please run either source ~/.bashrc(linux) or source ~/.zshrc(macOS).

How to Run

For the quick experience you can run go-onnxruntime using this command :

    docker build --platform linux/arm64/v8 -f dockerfile/Dockerfile_ubuntu_arm64_example -t go-onnxruntime .
    docker run --rm -it  go-onnxruntime:latest 

Note : Currently we only provide Dockerfile for ubuntu arm64 architecture.

Examples

Examples of using the Go Onnxruntime binding to do model inference are under examples.

Credits

Some of the logic of conversion is referenced from https://github.com/c3sr/go-onnxruntime.

go-onnxruntime's People

Contributors

ivansuteja96 avatar tystuyfzand avatar

Watchers

 avatar

Forkers

keymantics

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.