Skip to content

Instantly share code, notes, and snippets.

@eavidan
Created February 11, 2018 13:42
Show Gist options
  • Save eavidan/22ad044f909e5739ceca9ff9e6feaa43 to your computer and use it in GitHub Desktop.
Save eavidan/22ad044f909e5739ceca9ff9e6feaa43 to your computer and use it in GitHub Desktop.
converting Tensorflow serving PredicResponse into np array
def predictResponse_into_nparray(response, output_tensor_name):
dims = response.outputs[output_tensor_name].tensor_shape.dim
shape = tuple(d.size for d in dims)
print(shape)
return np.reshape(response.outputs[output_tensor_name].float_val, shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment