Comments (19)
Although we may not pursue this ourselves, the internal formats used for communication (GraphDef
, etc.) are all platform independent protobuf. Thus, it is possible to implement all or part of the tensorflow API in Java while preserving communication compatibility with the existing code. Since a Java version would likely be slower, one useful bit would be a pure inference layer that evaluates graphs but isn't necessarily able to build them; this would allow graphs built in Python and trained in Python / C++ on GPUs to be run from Java servers.
from tensorflow.
Since raw performance is one of the goals of this library I think that pure implementations don't make too much sense.
A prettier API on top of the generated interfaces would be nice though.
from tensorflow.
Is there a canonical / repeatable test suite, so language bindings can have a target and level of confidence? Is there a build server? Could there be a build server?
from tensorflow.
There's a testsuite with fairly good converge, but currently it's mostly Python with a few C++ tests. There's also a lot of functionality for building graphs that's currently Python only, in particular the automatic differentiation functionality, though that doesn't matter for evaluation of graphs in Java. There are plans to move this functionality into the underlying C++ in future, at which point Java SWIG bindings would be more useful for creating graphs.
If someone takes up the Java SWIG challenge, we'd be happy to accept it upstream pending review, etc., at which point it would be part of our continuous testing. The details of accepting contributions is in flux at the moment, but that will stabilize.
from tensorflow.
Also perhaps https://github.com/bytedeco/javacpp can be used to generate bindings.
from tensorflow.
@girving What aspect of automatic differentiation is not available from other languages? Is that just for defining new ops?
from tensorflow.
If you search for RegisterGradient
in the python directory, you'll see all the places we define the gradients of various ops. The gradients are defined by Python code, so they aren't available from pure C++ as yet (we hope to change this at some point).
from tensorflow.
I don't fully grasp the architecture/order of operations, but could one populate the gradients using python, while still calling into the C++ code via a bridge?
Alternatively: Run the python code once to generate the gradients for every op, serialize all those gradients to a file, and then other runtimes can read them off and register them?
from tensorflow.
Both of those might work, but I don't know how much of a savings they are compared to doing it the right way and porting the code to C++.
from tensorflow.
I fully agree, just sounding out a temporary solution so I'm not blocked (I imagine it might be a while before all that code is ported)
from tensorflow.
If all the functionality is not available in the C++ core then porting will be very difficult and some cases not possible (with respect to a fully functional version). Also I opened this: #476
from tensorflow.
+1 for Java
from tensorflow.
+1 for java
from tensorflow.
+1 for Java.
from tensorflow.
+1 for Java
from tensorflow.
+1 for Java/Scala
from tensorflow.
+1
from tensorflow.
@girving I want to contribute to tensorflow java api,
I used to implement the PHP frontend of Apache Spark alone.
Where to start?
from tensorflow.
Closing this out as a duplicate of #5 and #18.
from tensorflow.
Related Issues (20)
- Infinity loop when try to save model with input_signatures on funtion decorator
- Tensorflow does not recognice GPU no matter what HOT 2
- __dict__ error when saving a model using tf.saved_model.save(model, modelSavedPath)
- softplus on zero values is incorrect HOT 3
- We integrate tensorflow movenet with our webapp, and it stopped working (it worked two weeks ago) with the following error message, what can be the possible reasons and how to fix it? HOT 2
- Tensorflow TF ops - CPU Factory not registered HOT 8
- Complex dtype input for keras layer in tf2.16+
- [Android x86_64] [TFLite] `Fatal signal 11 (SIGSEGV), code 128 (SI_KERNEL), fault addr 0x0` crash from `libtensorflowlite.so` HOT 1
- [DOCS] Missing complex input for Round op HOT 1
- Ensemble provides either correct or (the same) incorrect inference results HOT 1
- tf.keras.utils.plot_model doesn't work
- tf.raw_ops.Unbatch aborts with "Check failed: d < dims()" HOT 3
- Incorrect documentation of the hard_sigmoid activation function (TensorFlow 2.16.1) HOT 2
- CategoryEncoding layer with output_mode count as part of a model no longer working in TensorFlow 2.16.1 HOT 1
- TimeDistributed layer with nested model no longer working in TensorFlow 2.16.1
- Loading of a model with a Bidirectional LSTM layer no longer working in TensorFlow 2.16.1
- Documentation for RaggedTensors does not match Input layer documentation
- Tensorflow doesn't work on my data HOT 2
- Segmentation fault when using tflite_model_maker searcher.TextDataLoader.create(EmbeddingModel, l2_normalize=True)
- ValueError: Only instances of `keras.Layer` can be added to a Sequential model. " Keras version - 3.5.0" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow.