Giter VIP home page Giter VIP logo

nlp_tflite's Introduction

c++调用tflite

一,进入到char-rnn下面训练模型,并将模型转换成tflite。详见char-rnn/README.md

二,编译libtensorflowlite.so文件(mac下测试,linux类似)

三,进入到cpp_tflite中,引入头文件和so文件

  • 1,将tflite的头文件放置到include下(cd tensorflow/tensorflow) (find ./lite -name "*.h" | tar -cf headers.tar -T -)
  • 2,将上面的headders.tar压缩包移动到自己项目下的cpp_tflite/include中并解压,解压后可以直接去除
  • 3,将tensorflow/bazel-bin/tensorflow/lite/libtensorflowlite.so和tensorflow/bazel-bin/external/flatbuffers/libflatbuffers.a 放到cpp_tflite/lib文件夹中
  • 4,进入到tensorflow/tensorflow/lite/tools/make下执行download_dependencies.sh,或者直接下载 flatbuffers压缩包,然后取出include的内容放置到cpp_tflite/include中即可。
  • 5,编写CMakeLists.txt,链接到so文件
  • 6,mkdir build
  • 7,cd build
  • 8,cmake ..
  • 9,make
  • 10,./nlp_tflite

nlp_tflite's People

Contributors

jiangxinyang227 avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Forkers

lizhuangliu

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.