Giter Site home page Giter Site logo

fernandolpz / onnx-pytorch-tf-caffe2 Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 432 KB

This repository shows an example of how to use the ONNX standard to interoperate between different frameworks. In this example, we train a model with PyTorch and make predictions with Tensorflow, ONNX Runtime, and Caffe2.

Python 97.83% Dockerfile 2.17%
onnx onnxruntime onnx-torch onnx-models onnx-tf onnx-caffe2 pytorch tensorflow caffe2 interoperability

onnx-pytorch-tf-caffe2's Introduction

Medium Twitter Linkedin

ONNX: Preventing Framework Lock in

This repository shows an example of how to use the ONNX standard to interoperate between different frameworks. In this example,we train a model with PyTorch and make predictions with Tensorflow, ONNX Runtime, and Caffe2.

If you want to understand the details about how this model was created, take a look at this very clear and detailed explanation: ONNX: Preventing Framework Lock in

Table of Contents

1. The model

The aim of this example is to demonstrate how to use the ONNX standard to be able to interoperate between different Deep Learning frameworks. The architecture of the example is given as follows, we are going to train a classifier in PyTorch, then we are going to use this trained model to perform inference in Tensorflow, Caffe2 and ONNX Runtime. The architecture of the example is given as follows:

2. Files

  • data: Here you will find the dataset generator
  • model: It contains the definition of the PyTorch model as well as the training function
  • onnx: Here it will be saved the exported Pytorch model as ONNX file
  • src: It contains the class where each evaluator is called
  • main.py: This file trigger the entire pipeline (data generation, training, export and load the onnx model, inference)

3. How to use

You just need to type

python main.py

however, I recommend you to work with the docker container, just need to build and run the image.

4. Contributing

Feel free to fork the model and add your own suggestiongs.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/YourGreatFeature)
  3. Commit your Changes (git commit -m 'Add some YourGreatFeature')
  4. Push to the Branch (git push origin feature/YourGreatFeature)
  5. Open a Pull Request

5. Contact

If you have any question, feel free to reach me out at:

6. License

Distributed under the MIT License. See LICENSE.md for more information.

onnx-pytorch-tf-caffe2's People

Contributors

fernandolpz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kimmaa luis198755

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.