Giter Club home page Giter Club logo

tensorflow4j's Introduction

TensorFlow proto

Since TensorFlow and TensorFlow-Serving do not support official jars for their protobuf files right now, we create this project to do it just for convenience and sharing.

Usage

tensorflow-proto contains and compiles all protobuf files in TensorFlow, and serving-proto does that for TensorFlow-Serving. Since compiling of serving-proto imports protobuf from tensorflow-proto, actually serving-proto contains all that tensorflow-proto has. Therefore serving-proto is the only library you need when you want to do something with TensorFlow-Serving.

maven:

<dependencies>
    <dependency>
        <groupId>xyz.codemeans.tensorflow4j</groupId>
        <artifactId>tensorflow-proto</artifactId>
        <version>1.12.0</version>
    </dependency>

    <dependency>
        <groupId>xyz.codemeans.tensorflow4j</groupId>
        <artifactId>serving-proto</artifactId>
        <version>1.12.0</version>
    </dependency>
</dependencies>

gradle:

implementation 'xyz.codemeans.tensorflow4j:tensorflow-proto:1.12.0'

implementation 'xyz.codemeans.tensorflow4j:serving-proto:1.12.0'

Sync Protobuf Files

Clone those two projects, checkout the latest version(or any other version you want), and then run:

python sync_proto.py /path/to/tensorflow_project tensorflow-proto
python sync_proto.py /path/to/tensorflow_serving_project serving-proto

NOTE: a little BUGFIX must be done to tensorflow/compiler/tf2xla/host_compute_metadata.proto, change java_outer_classname as below:

// option java_outer_classname = "Tf2XlaProtos";
option java_outer_classname = "HostComputeMetadataProtos";

Build JAR Library

Requirements:

  • protoc
  • gradle
  • protobuf lib

run:

gradle clean build

If you want to publish the built jars, you can run:

# publish to local maven repository (`~/.m2`)
gradle local

or

# config maven publishing and publish to nexus
gradle publish

Version

Current version of TensorFlow and TensorFlow-Servng are both 1.12.0.

If you want to build library for another version, you MUST:

  • checkout TensorFlow and TensorFlow-Serving source of exact version you want, then sync all proto files
  • change version and publish setting in build.gradle for publishing somewhere

tensorflow4j's People

Contributors

yuanwenqing 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.