Coder Social home page Coder Social logo

paulgavrikov / tflite2onnx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhenhuaw-me/tflite2onnx

0.0 0.0 0.0 140.74 MB

Convert TensorFlow Lite models (*.tflite) to ONNX.

Home Page: https://jackwish.net/tflite2onnx

License: Apache License 2.0

Python 97.98% Shell 2.02%

tflite2onnx's Introduction

tflite2onnx - Convert TensorFlow Lite models to ONNX

Build and Test Sanity Coverage

tflite2onnx converts TensorFlow Lite (TFLite) models (*.tflite) to ONNX models (*.onnx), with data layout and quantization semantic properly handled (check the introduction blog for detail).

Highlights

  • If you'd like to convert a TensorFlow model (frozen graph *.pb, SavedModel or whatever) to ONNX, try tf2onnx. Or, you can firstly convert it to a TFLite (*.tflite) model, and then convert the TFLite model to ONNX.

  • It's significant to understand the use cases of tflite2onnx, which helps us to decide how to shape tflite2onnx - what features we take as first priority for example. Please help to provide some input in this issue

  • Support of this tool is by best effort - we have very limited resouce, i.e. basically off time effort by the maintainers. So we encourage you to deep dive into your issue and then discuss with us to figure out a solution. Please join to improve!

Installation

Install via pip pip install tflite2onnx.

Or install from source to get latest features:

  1. Download the source code: git clone https://github.com/jackwish/tflite2onnx.git
  2. Build the package: ${tflite2onnx}/scripts/build-wheel.sh
  3. Install the built package: pip install assets/dist/tflite2onnx-*.whl

Or you can just add the code tree to your $PYTHONPATH. (Command line tool is not avaiable in this mode.)

export PYTHONPATH=$(pwd):${PYTHONPATH}

Usage

Python Interface

import tflite2onnx

tflite_path = '/path/to/original/tflite/model'
onnx_path = '/path/to/save/converted/onnx/model'

tflite2onnx.convert(tflite_path, onnx_path)

tflite2onnx now supports explicit layout, check the test example.

Command Line

tflite2onnx /path/to/original/tflite/model /path/to/save/converted/onnx/model

Documentation

Contributing

Check contribution guide for more.

License

Apache License Version 2.0.

tflite2onnx's People

Contributors

zhenhuaw-me avatar briangrifiin avatar erizmr avatar ikbeomjeon avatar

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.