You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue to trace effort of swig interface for java. Started implementation - will update with progress. If anyone has any comments/tips - please feel welcome to join the discussion!
Reacted by levonk, Eduard Dudar, Philip Yurchuk, Alex Ayala, Philip Stutz, Huy Le, Romulo Messias, desperado, gioborelli, Soroush Mirzaei and 78 more
Reacted by Stephen Hopper, Artsiom Strok, Joe Souter, Russell Klopfer, Willie Chalmers III, Kervin Pierre, Kirill Zotov, Quantum64, Mykola Golubyev and up-to-you
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.
Hello guys
We are also interested in adapting TensorFlow for Java. @ravwojdyla Have you, by any chance, started working on the Swig Interface for Java? If you have, we could join our efforts and collaborate on that
Reacted by levonk, Xiong Jun Wu(熊君武), dripp1, Kirill Zotov and Wenbo Tian
Hello,
I am working on a SWIG wrap of the main C++ API. You can see my progress thus far on my fork, but what's up there is not finished; I'm currently experiencing a problem in which #include "tensorflow/core/lib/core/error_codes.pb.h" is unable to be resolved and I cannot find the intended file anywhere within the project files. Input of any kind would be greatly appreciated.
Very nicely done @saudet! I have almost finished a SWIG wrap, but it seems that your implementation works just as well. I do not see anything that my SWIG wrap can do that yours cannot do. JavaCPP seems very cool, I'll have to look into using it for future projects.
@tngan Yes, that is what I discovered as well. Additionally, the .proto files in this project require ProtoBuff3 to be used. I'm using Ubuntu 14.04 and ProtoBuff3 was not available in my package manager, so I compiled it from source, which I got from the 3.0.0 beta release.
The current roadblock which I am trying to solve is how to get ProtoBuff to recurse over the entire file tree and compile the .proto files into .h and .cc files; doing each folder piecemeal results in failures due to unsatisfied dependencies upon other yet to be compiled .proto files.
@kylevedder Are your SWIG wrappers in a separate repository or are you working in the tensorflow repository? protoc works similar to other compilers. If you are working in the tensorflow repository or are using Bazel, then you would need to set up the protobuf build targets and the dependencies among them.
If you are working in a separate repository and using a different build system, then you would need to use the protobuf plugin for that build system.
I'd be happy to help you set up the build if you would like.
@davidzchen Thank you for the offer, any and all help is greatly appreciated.
What I have thus far:
I have already setup Bazel and gotten it to compile into a .whl file, which I then handed over to pip and confirmed that I can run the First TensorFlow program.
I have generated SWIG wrapper files in my forked repository. They are in a folder under core/javaWrapper. [link]
What I am trying to do:
Ultimately, my goal is to generate a .so file which than can be called as a native library in Java. Currently, I'm attempting to use g++ to compile the entire system into a .so file; however, the .proto files need to first be expanded into .hs and .ccs prior to this compilation, and that is what I am trying to do with protoc.
You can see my attempt at a wrap script here to potentially get a better idea of what it is I am getting at, although thus far all of my attempts at using protoc has been directory by directory and, consequently, not in the script.
Finally, any feedback on areas of improvement would be greatly appreciated. Thanks!
Activity
girving commentedon Nov 9, 2015
Nice!
girving commentedon Nov 9, 2015
Moving this comment here from #3:
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.
pslam commentedon Nov 18, 2015
Hello guys
We are also interested in adapting TensorFlow for Java. @ravwojdyla Have you, by any chance, started working on the Swig Interface for Java? If you have, we could join our efforts and collaborate on that
kylevedder commentedon Nov 22, 2015
Hello,
I am working on a SWIG wrap of the main C++ API. You can see my progress thus far on my fork, but what's up there is not finished; I'm currently experiencing a problem in which
#include "tensorflow/core/lib/core/error_codes.pb.h"is unable to be resolved and I cannot find the intended file anywhere within the project files. Input of any kind would be greatly appreciated.bhack commentedon Nov 22, 2015
There are javacpp preset available for libiraries like Caffe and OpenCV. See also bytedeco/javacpp-presets#111. Java-cpp enable also IOS with RoboVM
bhack commentedon Nov 22, 2015
@girving Initial commit at bytedeco/javacpp-presets@374e1d5
bhack commentedon Nov 22, 2015
/cc @saudet
ravwojdyla commentedon Nov 22, 2015
@pslam - I was able to work just a little bit on this - could definitely use some help!
saudet commentedon Nov 23, 2015
Hi guys, I believe I have pretty functional bindings for JavaCPP: https://github.com/bytedeco/javacpp-presets/tree/master/tensorflow. Let me know if you see anything that could be done with SWIG, but not JavaCPP. I could definitely use the feedback. (Thanks for the cc @bhack!)
kylevedder commentedon Nov 23, 2015
Very nicely done @saudet! I have almost finished a SWIG wrap, but it seems that your implementation works just as well. I do not see anything that my SWIG wrap can do that yours cannot do. JavaCPP seems very cool, I'll have to look into using it for future projects.
tngan commentedon Nov 23, 2015
Hi @kylevedder, have you resolved the issue related to
error_codes.pb.h?[Edited]
All .pb.h files are compiled from .proto
kylevedder commentedon Nov 23, 2015
@tngan Yes, that is what I discovered as well. Additionally, the
.protofiles in this project require ProtoBuff3 to be used. I'm using Ubuntu 14.04 and ProtoBuff3 was not available in my package manager, so I compiled it from source, which I got from the 3.0.0 beta release.The current roadblock which I am trying to solve is how to get ProtoBuff to recurse over the entire file tree and compile the
.protofiles into.hand.ccfiles; doing each folder piecemeal results in failures due to unsatisfied dependencies upon other yet to be compiled.protofiles.davidzchen commentedon Nov 24, 2015
@kylevedder Are your SWIG wrappers in a separate repository or are you working in the tensorflow repository?
protocworks similar to other compilers. If you are working in the tensorflow repository or are using Bazel, then you would need to set up the protobuf build targets and the dependencies among them.If you are working in a separate repository and using a different build system, then you would need to use the protobuf plugin for that build system.
I'd be happy to help you set up the build if you would like.
kylevedder commentedon Nov 24, 2015
@davidzchen Thank you for the offer, any and all help is greatly appreciated.
What I have thus far:
I have already setup Bazel and gotten it to compile into a
.whlfile, which I then handed over topipand confirmed that I can run the First TensorFlow program.I have generated SWIG wrapper files in my forked repository. They are in a folder under
core/javaWrapper. [link]What I am trying to do:
Ultimately, my goal is to generate a
.sofile which than can be called as a native library in Java. Currently, I'm attempting to use g++ to compile the entire system into a.sofile; however, the.protofiles need to first be expanded into.hs and.ccs prior to this compilation, and that is what I am trying to do withprotoc.You can see my attempt at a wrap script here to potentially get a better idea of what it is I am getting at, although thus far all of my attempts at using
protochas been directory by directory and, consequently, not in the script.Finally, any feedback on areas of improvement would be greatly appreciated. Thanks!
160 remaining items
PR #24898: [ROCM] fix asan invalid memory access in redzone allocator…
PR #24898: [ROCM] fix asan invalid memory access in redzone allocator…
PR #24900: [ROCM] fix invalid memory access in rocm executor
PR #24900: [ROCM] fix invalid memory access in rocm executor
PR #25269: [ROCM] Fix asan issue do to a singleton in header file
PR #25269: [ROCM] Fix asan issue do to a singleton in header file
PR #25269: [ROCM] Fix asan issue do to a singleton in header file
Fix crash on reentrant call to LRUCache::Clear().
Fix crash on reentrant call to LRUCache::Clear().
Fix crash on reentrant call to LRUCache::Clear().
Fix crash on reentrant call to LRUCache::Clear().
Fix crash on reentrant call to LRUCache::Clear().
Fix crash on reentrant call to LRUCache::Clear().
PR #38932: [xla:gpu] Add rendezvous before AND after first collective…
PR #38932: [xla:gpu] Add rendezvous before AND after first collective…