All Projects → datainq → go-mnist-client

datainq / go-mnist-client

Licence: Apache-2.0 license
TensorFlow serving mnist example client in Go.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-mnist-client

generative-art
🌈🎨 Generative Art is the idea realized as genetic code of artificial events, as construction of dynamic complex systems able to generate endless variations. This is also a nuxt-module (@luxdamore/nuxt-canvas-sketch) - [three.js, tensorflow.js and gsap are not included].
Stars: ✭ 41 (+156.25%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
tensorflow-fifo-queue-example
Example on how to use a Tensorflow Queue to feed data to your models.
Stars: ✭ 39 (+143.75%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Androidtensorflowmachinelearningexample
Android TensorFlow MachineLearning Example (Building TensorFlow for Android)
Stars: ✭ 1,369 (+8456.25%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Tensorflow Brasil
Códigos e materiais sobre TensorFlow em Português
Stars: ✭ 74 (+362.5%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Nakedtensor
Bare bone examples of machine learning in TensorFlow
Stars: ✭ 2,443 (+15168.75%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Free Tensorflow
Tensorflow 免费中文视频教程,开源代码,免费书籍.
Stars: ✭ 83 (+418.75%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Tensorflow In Practice Code
源码实现:《TensorFlow实战》黄文坚,唐源 著
Stars: ✭ 176 (+1000%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Tensorflow Find Object
📸 A simple application to demonstrate TensorflowJS using mobile net model to predict objects via camera API.
Stars: ✭ 12 (-25%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
tf-examples
TensorFlow examples
Stars: ✭ 23 (+43.75%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Cs224d
Code for Stanford CS224D: deep learning for natural language understanding
Stars: ✭ 222 (+1287.5%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Math object detection
An image recognition/object detection model that detects handwritten digits and simple math operators. The output of the predicted objects (numbers & math operators) is then evaluated and solved.
Stars: ✭ 52 (+225%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
deep-learning-in-s4tf
Get started with Swift for TensorFlow by examples
Stars: ✭ 31 (+93.75%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Tensorflow Sentiment Analysis On Amazon Reviews Data
Implementing different RNN models (LSTM,GRU) & Convolution models (Conv1D, Conv2D) on a subset of Amazon Reviews data with TensorFlow on Python 3. A sentiment analysis project.
Stars: ✭ 34 (+112.5%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Ml Classifier
A tool for quickly training image classifiers in the browser
Stars: ✭ 97 (+506.25%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Letslearnai.github.io
Lets Learn AI
Stars: ✭ 33 (+106.25%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Chatgirl
ChatGirl is an AI ChatBot based on TensorFlow Seq2Seq Model. ChatGirl 一个基于 TensorFlow Seq2Seq 模型的聊天机器人。(包含预处理过的 twitter 英文数据集,训练,运行,工具代码,来波 Star 。)QQ群:167122861
Stars: ✭ 105 (+556.25%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
My Tensorflow Tutorials
This repo contains all of my TensorFlow tutorials
Stars: ✭ 795 (+4868.75%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Machine Learning Collection
A resource for learning about ML, DL, PyTorch and TensorFlow. Feedback always appreciated :)
Stars: ✭ 883 (+5418.75%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Yolov3 Tf2
YoloV3 Implemented in Tensorflow 2.0
Stars: ✭ 2,327 (+14443.75%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples
Ml Classifier Ui
A UI tool for quickly training image classifiers in the browser
Stars: ✭ 224 (+1300%)
Mutual labels:  tensorflow-tutorials, tensorflow-examples

go-mnist-client

An example of tensorflow_serving client in Go.

It demonstrates how to connect to the tensorflow_model_server launched as described in Serving a TensorFlow Model on TensorFlow documentation webpage.

The main problem with tensorflow_serving is a lack of Go package ready to import and run.

This example is based on: github.com/tobegit3hub/tensorflow_template_application

Setup fake workspace through a$GOPATH or copy files

For a convenience, I provide the generated files under the gopath subdirectory. You can copy files directly to your $GOPATH.

cp gopath/src $GOPATH

Generating from sources

For a purpose of generating proto we will use a docker container grpc/go with protoc, go and gRPC protoc extension installed.

Remember that a version of TensorFlow Serving, TensorFlow C++ library and and Go TensorFlow library versions should match.

go get -u golang.org/x/net/context
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u google.golang.org/grpc
go get -u github.com/tensorflow/tensorflow/tensorflow/go
go get -u go.uber.org/ratelimit

Let's start a docker container mounting a fake gopath:

docker run --rm -it -v $PWD/gopath:/gopath:ro -v $PWD/gen:/gen grpc/go /bin/bash

and copy paste:

export GOPATH=/gopath

git clone https://github.com/tensorflow/serving
git clone https://github.com/tensorflow/tensorflow

IN=$PWD
OUT=/gen
protoc -I=$IN/serving -I $IN/tensorflow \
    --go_out=plugins=grpc:$OUT \
    $IN/serving/tensorflow_serving/apis/*.proto

IN=$PWD/tensorflow
protoc -I=$IN --go_out=plugins=grpc:$OUT \
    $IN/tensorflow/core/framework/*.proto
    
protoc -I=$IN --go_out=plugins=grpc:$OUT \
    $IN/tensorflow/core/protobuf/{saver,meta_graph}.proto
    
protoc -I=$IN --go_out=plugins=grpc:$OUT \
    $IN/tensorflow/core/example/*.proto

In most cases we have to fix permissions:

sudo chown -R $USER.$USER gen

Most of the tensorflow_serving and tensorflow is not prepared to be imported in go directly, therefore we must fix incorrect import paths:

grep -rl '"tensorflow/' --include \*.go gen | 
xargs sed -i 's/"tensorflow\//"github.com\/tensorflow\/tensorflow\/tensorflow\/go\//g'

And now we need to copy files into the GOPATH:

mkdir -p $GOPATH/src/github.com/tensorflow/serving
cp -R gen/tensorflow_serving $GOPATH/src/github.com/tensorflow/serving/
mkdir -p $GOPATH/src/github.com/tensorflow/tensorflow/tensorflow/go/
cp -R gen/tensorflow/core $GOPATH/src/github.com/tensorflow/tensorflow/tensorflow/go/
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].