Skip to content

Instantly share code, notes, and snippets.

@ClementWalter
Created September 23, 2020 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ClementWalter/66a102382257b316bb4031669c809f79 to your computer and use it in GitHub Desktop.
Save ClementWalter/66a102382257b316bb4031669c809f79 to your computer and use it in GitHub Desktop.
Perform a batch request onto a Tensorflow served model with docker
response = requests.post(
"http://localhost:8501/v1/models/classifier:predict",
json={
"signature_name": "serving_default", # can be omitted
"inputs": {
"image_bytes": [image.numpy().decode("utf-8") for image in image_bytes][:2], # batch request
},
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment