I am using a trained Tensorflow model in Java on Android. I am trying to extract the output of an intermediary op.
The Tensor I am extracting has shape (150, 150, 256).
I have declared the output target to be
private float[] hybridValues;
hybridValues = new float[150 * 150 * 256];
I am then getting the output using.
inferenceInterface.fetch(OUTPUT_NODE, hybridValues);
The values are fine but they are stored as a 1D array. Is there a way to get inferenceinterface.fetch to return a multi-dimentional array?
I tried declaring hybridValue to be a three dimensional float array but that doesn't work as the fetch method expects a 1D array.
The end goal is to pass my output to a Python program that will feed the values to a Tensor of the same shape (150, 150, 256).
For comparison the Python a_output = graph.get_tensor_by_name('a2b_generator/Conv_7/Relu:0')
returns an ndarray with values in the same shape as the target tensor.