Created
February 11, 2018 13:42
-
-
Save eavidan/22ad044f909e5739ceca9ff9e6feaa43 to your computer and use it in GitHub Desktop.
converting Tensorflow serving PredicResponse into np array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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