Coder Social home page Coder Social logo

ferneutron / tfserving Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 426 KB

This repository contains code to train, export and serve a Tensorflow model with TFServing. Additionally, this repository provides the installation and configuration of TFServing through a Docker image.

Dockerfile 18.87% Python 81.13%
keras python tensorflow tfserving tfx

tfserving's Introduction

Model Deployment with TFServing

This repository contains code to train, export and serve a Tensorflow model with TFServing. Additionally, this repository provides the installation and configuration of TFServing through a Docker image.

alt text

How to use it?

It is recommended to follow the step by step described below. However, you can adapt the code to your needs.

Step 1.

Build the docker image as follows:

$ docker build -t tfserving:v1 .

Step 2.

Run the container and access it through the shell.

Note: It is recommended that you mount the current directory so that you have access to the python scripts. If you want to skip mounting the current directory, you will have to modify Dockerfile to add COPY commands to move scripts from the image build.

$ docker run -it -v $PWD:/home/app/ tfserving:v1 /bin/bash

Step 3.

Once you are inside the container, generate the train.csv and test.csv files, running the generate_data.py script.

$ python -B generate_data.py

Step 4.

Train and export the model.

$ python -B train.py

Step 5.

Launch TFServing server.

$ tensorflow_model_server --port=8500 --rest_api_port=8501 --model_name=saved_model --model_base_path="/tmp"

Note: Port 8500 will be used for gRPC calls while port 8501 will be used for REST requests.

Step 6.

REST and gRPC requests.

$ python -B inference_rest.py
$ python -B inference_grpc.py

tfserving's People

Contributors

ferneutron avatar ferneutronn avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  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.