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)
- Enhance Memory Optimizer with Dynamic Cost Model for Operation Recomputation HOT 1
- tf.linalg.slogdet returns incorrect values on GPU for singular matrix HOT 1
- `tf.linalg.solve` behaves inconsistently on GPU for singular matrices depending on shape HOT 2
- Tensorflow is aborting with CompositeTensorVariant already registered HOT 3
- tf.data.experimental.prefetch_to_device has no effect inside tf.distribute.Strategy.distribute_datasets_from_function. HOT 2
- How to run Android demo which uses NPU to inference? HOT 4
- Segmentation fault in tf.sets.size HOT 2
- TensorFlow disables SwiftUI Previews HOT 1
- how to build libtensorflowlite_c.so with Address Sanitizer HOT 2
- Some sorting related ops produce results inconsistent with NumPy when tensor contains NaN HOT 7
- Deeplabcut issue HOT 4
- i am storing jupyter notebook in e disk but have tensorflow in other disks HOT 2
- tf.nn.conv2d with invalid input dims crashes in TF ≤2.19 — now raises InvalidArgumentError in nightly HOT 1
- building //tensorflow/lite/ios:TensorFlowLiteC_xcframework results in broken header files HOT 3
- PERPRES HOT 1
- YoloX different Model Output for Python and Android HOT 1
- Using Tensorflow Variables as arguments in nested tf.function methods HOT 5
- how to use libtensorflowlite_c.so C API and delegate gpu opencl correctly?
- I'm a spammer HOT 2
- Runtime error when using empty axes for reduce operator
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.