How to set Session config in Tensorflow Java API?

2017-03-18T13:47:56

I'm trying to run Tensorflow in Android, using Tensorflow's Java API. I'm wondering how to set the Session config when creating a Session object.

In the Python API, you can do this by using the "config" option of the Session constructor (link). But in Java API, I don't see such an option in the Session constructor (link).

Copyright License:
Author:「Targo」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/42870978/how-to-set-session-config-in-tensorflow-java-api

About “How to set Session config in Tensorflow Java API?” questions

I'm trying to run Tensorflow in Android, using Tensorflow's Java API. I'm wondering how to set the Session config when creating a Session object. In the Python API, you can do this by using the "c...
I am trying to build and evaluate TensorFlow Graphs via the 1.4 Java API, on Linux. I have noticed that the Java API seems to reset the value of operation output tensors each time a call to Session...
I am using the Tensorflow Java Api to load an already created Tensorflow model into the JVM. I am using this as an example: tensorflow/examples/LabelImage.java Here is my simple scala code: impor...
How to set following config "gpu_options.allow_growth = True" for Tensorflow, using Java API? I tried in this way: model.session().runner() .setOptions("gpu_options.allow_growth =...
How can I view the default configuration options of a TensorFlow session? I am aware that I can pass configuration options through the config parameter when initializing a session, e.g.: # Launc...
I'm trying to migrate code from Tensorflow 1.13 to Tensorflow 2.0 and I'm having issues with the session declaration step. For now, I replaced tf.keras.backend.set_session by tf.compat.v1.keras.ba...
It seems that I must be able to set up a session using tf.GPUOptions.Experimental properties, such as use_unified_memory. But next thing doesn't work: cfg = tf.ConfigProto() cfg.gpu_options.
Tensorflow API has provided few pre-trained models and allowed us to trained them with any dataset. I would like to know how to initialize and use multiple graphs in one tensorflow session. I wan...
I have an application that uses Keras and Tensorflow 2.0. It seems to work until I try to set the number of inter and intra op threads. Here's how it's done. from keras import backend as K # some
(note, I've resolved my problem and posted the code at the bottom) I'm playing around with TensorFlow and the backend processing must take place in Java. I've taken one of the models from the htt...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.