How Do I Call TensorFlow from Java?

Here are a few options to call TensorFlow from Java:
 
1) load and call the graph directly from Java using TensorFlow’s Java API:  https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/src/main/java/org/tensorflow/examples/LabelImage.java
 
2) make a JNI call from Java into the TensorFlow Serving’s C++ library libtensorflow.so https://github.com/tensorflow/tensorflow/issues/2412
 
3) make a gRPC call from Java to a running TensorFlow Serving process:  https://github.com/tobegit3hub/deep_cnn/blob/master/java_predict_client/src/main/java/com/tobe/InceptionPredictClient.java
 
Have more questions? Submit a request

Comments