Coder Social home page Coder Social logo

dorucioclea / keras-serving Goto Github PK

View Code? Open in Web Editor NEW

This project forked from krystianity/keras-serving

0.0 1.0 0.0 21.09 MB

bring keras-models to production with tensorflow-serving and nodejs + docker :pizza:

License: Apache License 2.0

Python 54.96% JavaScript 31.82% Shell 3.40% Dockerfile 9.82%

keras-serving's Introduction

keras-serving

keras->tensorflow+grpc+docker=>nodejs ๐Ÿณ๐Ÿ”ฅ

  • example of bringing a keras model to production using tensorflow serving
  • using custom XOR model with tensor.proto dimensions example
  • building & training of the model works with python2.7 on the workstation
  • exported model is served via grpc in a C++ server using a Docker-Container
  • a nodejs server wraps the grpc api for a simple http POST endpoint
  • also ships an advanced multi-model face (emotion, gender) detection example /face-recog
  • and and advanced google bigquery (as dataaset) example /bigquery

Overview

Workflow (Unix - testen on Ubuntu 16.04 64bit)

You will need

python
pip
docker (docker-compose)

1. Install Requirements

./prepare.sh
# installs python dependencies via pip
# builds the docker image for tensorflow_serving (takes a while ~ 30 minutes)
# image size ~ 3.5 GB

checkout build troubleshoot if you are having trouble

2. Build, Train and Serialise Keras Model

python train.py
# results will be in (/result)

3. Load and export Model as Tensorflow Graph

python export.py
# results will be in (/export)

4. Build & Run Containers via docker-compose

./start-servers.sh
# ./stop-servers.sh

5. Test API via curl

curl -X POST \
  http://localhost:8080/predict-xor \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{"inputs": [0,1]}'

keras-serving's People

Contributors

dependabot[bot] avatar krystianity avatar

Watchers

 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.