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)
- TypeError: Exception encountered when calling layer "custom_crop_layer_2" " f"(type CustomCropLayer). HOT 2
- TensorFlow 2.16 / Keras 3 have undocumented breaking API changes HOT 3
- im getting this error in jupyter- Exception encountered when calling Lambda.call() in this line- attention_context = Lambda(lambda x: tf.einsum('ijk,ijl->ikl', x[0], x[1]))([attention_scores, se3]) HOT 1
- Predict crashes if last batch is smaller then batch_size HOT 2
- Comment in detection_postprocess.cc is incorrect and misleading. HOT 2
- tf.keras.layers.PReLU outputs NaN on positive input HOT 3
- load_model is failing to load a model created by a save. It reports an IndexError HOT 2
- TPU Colab Issue HOT 1
- TensorFlow 2.16 API docs not available online HOT 3
- GPU libraries not found in Google Colab Pro
- tf.math.angle(nan) returns inconsistent results on dtype float64 / complex128.
- Adding TensorFlow Hub KerasLayer to Sequential Model Raises ValueError HOT 5
- tf.linalg.svd([inf, -inf]) throws internal error logs to the console, and generates inconsistent results on different dtypes. HOT 3
- "ValueError: Layer 'dense' expected 1 input(s). Received 2 instead" on tf.keras.models.load_model HOT 2
- TF 2.16.1 and Apple Silicon GPU support not working. HOT 3
- Conv3D Operation Error on Windows platform HOT 2
- TFLite 2.16.1 conversions fail with "AttributeError: 'Sequential' object has no attribute '_get_save_spec'" HOT 4
- Aborted (core dumped) in tf.raw_ops.SparseMatrixZeros HOT 1
- Tensorflow WSL GPU CUDA recognition issue RTX3090 HOT 8
- Selectively build TFLite frameworks failed! HOT 1
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.