All Projects → fzschornack → Tensorflow Java Client

fzschornack / Tensorflow Java Client

Example of Java/Scala grpc client for tensorflow_serving (https://github.com/tensorflow/serving)

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Tensorflow Java Client

Brpc Java
Java implementation for Baidu RPC, multi-protocol & high performance RPC.
Stars: ✭ 647 (+3135%)
Mutual labels:  protobuf
Bluezero
Middleware for distributed applications
Stars: ✭ 17 (-15%)
Mutual labels:  protobuf
Protobuf Swift
Google ProtocolBuffers for Apple Swift
Stars: ✭ 925 (+4525%)
Mutual labels:  protobuf
Go Proto Validators
Generate message validators from .proto annotations.
Stars: ✭ 713 (+3465%)
Mutual labels:  protobuf
Pwned
Simple C++ code for simple tasks
Stars: ✭ 16 (-20%)
Mutual labels:  protobuf
Avatar Fight Client
基于cocos creator的联网对战小游戏:头像大乱战(protobuf版)
Stars: ✭ 22 (+10%)
Mutual labels:  protobuf
Grpclib
Pure-Python gRPC implementation for asyncio
Stars: ✭ 615 (+2975%)
Mutual labels:  protobuf
Grpc
An Elixir implementation of gRPC
Stars: ✭ 858 (+4190%)
Mutual labels:  protobuf
Protobuf Uml Diagram
Create UML diagrams from Protobuf compiled .proto files using Python
Stars: ✭ 17 (-15%)
Mutual labels:  protobuf
Grpc Jersey
gRPC<->Jersey bridge
Stars: ✭ 23 (+15%)
Mutual labels:  protobuf
Pogoprotos
A central repository for all proto files of PokémonGO.
Stars: ✭ 740 (+3600%)
Mutual labels:  protobuf
Pbtk
A toolset for reverse engineering and fuzzing Protobuf-based apps
Stars: ✭ 791 (+3855%)
Mutual labels:  protobuf
Protobuf Convert
Macros for convenient serialization of Rust data structures into/from Protocol Buffers 3
Stars: ✭ 22 (+10%)
Mutual labels:  protobuf
Protoreflect
Reflection (Rich Descriptors) for Go Protocol Buffers
Stars: ✭ 651 (+3155%)
Mutual labels:  protobuf
Protobuf Decompiler
Stars: ✭ 9 (-55%)
Mutual labels:  protobuf
New Bee
开源社区 vue + springBoot - 前后分离微服务的最佳实践
Stars: ✭ 619 (+2995%)
Mutual labels:  protobuf
Grpc.jl
gRPC framework for Julia
Stars: ✭ 18 (-10%)
Mutual labels:  protobuf
Pgoapi
Unofficial PokemonGO API in Python
Stars: ✭ 874 (+4270%)
Mutual labels:  protobuf
Go Micro Services
HTTP up front, Protobufs in the rear
Stars: ✭ 853 (+4165%)
Mutual labels:  protobuf
Rpc Thunderdome
A comparison between Proteus RPC and other commonly used RPC frameworks
Stars: ✭ 22 (+10%)
Mutual labels:  protobuf

tensorflow-java-client

Example of Java/Scala grpc client for tensorflow_serving (https://github.com/tensorflow/serving)

How to generate the Java service files (Mac OS X 10.10.5)

grpc-java

first you have to install protobuf (and protoc) in your machine (the current version is 3.1.0v):

$ brew install protobuf

then you have to build the grpc-java plugin (https://github.com/grpc/grpc-java/tree/master/compiler) and also the grpc-java project (https://github.com/grpc/grpc-java) to use the generated libs:

$ git clone https://github.com/grpc/grpc-java.git
$ cd compiler
$ ../gradlew java_pluginExecutable

The generated plugin is inside <project-root>/compiler/build/exe/java_plugin/

To build the grpc-java project, first create the file <project-root>/gradle.properties and add the line skipCodegen=true into it. Then, inside terminal, navigate to the root directory and execute

$ ./gradlew_build

The generated libs are inside the folders <project-root>/<module>/build/libs/

I had many dependency problems, that is why I had to build the grpc-java code and use the libs created during the build (the grpc-java version available in mavencentral seems to be outdated).

tensorflow_serving

Then you have to compile the tensorflow_serving .proto files inside serving/tensorflow_serving/apis and serving/tensorflow/tensorflow/core/framework.

The .proto files inside apis have dependencies that are inside ..tensorflow/core/framework/ so, to make things easier, I copied the proto files from apis to framework.

I had problems with the import paths used inside the .proto files so I had to edit them, e.g.:

import tensorflow/core/framework/some.proto 

was changed to

import some.proto

because all the .proto files were in the same directory.

Inside terminal, navigate to serving/tensorflow/tensorflow/core/framework and compile the files using the java-plugin with the command:

$ protoc -I=$SRC_DIR --plugin=protoc-gen-grpc-java=protoc-gen-grpc-java \
--grpc-java_out=$OUT_DIR --java_out=$OUT_DIR *.proto

My $SRC_DIR is . (the folder I am already in) and my $OUT_DIR is java-pb-files:

$ /usr/local/Cellar/protobuf/3.1.0/bin/protoc -I=. --plugin=protoc-gen-grpc-java=protoc-gen-grpc-java \
--grpc-java_out=java-pb-files --java_out=java-pb-files *.proto
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].