Closed rbavery closed 2 years ago
@ingalls pointed out that the metadata endpoint describes what the model expects, and I think the issue is I was supplying a base64 encoded image but the model doesn't expect this
# rave at rave-desktop in ~/animl/animl-ml on git:fix-requirement-mac ✖︎ [17:26:08]
→ GET http://localhost:8501/v1/models/model/metadata
{
"model_spec":{
"name": "model",
"signature_name": "",
"version": "1"
}
,
"metadata": {"signature_def": {
"signature_def": {
"serving_default": {
"inputs": {
"inputs": {
"dtype": "DT_UINT8",
"tensor_shape": {
"dim": [
{
"size": "-1",
"name": ""
},
{
"size": "-1",
"name": ""
},
{
"size": "-1",
"name": ""
},
{
"size": "3",
"name": ""
}
],
"unknown_rank": false
},
"name": "image_tensor:0"
}
},
"outputs": {
"detection_classes": {
"dtype": "DT_FLOAT",
"tensor_shape": {
"dim": [
{
"size": "-1",
"name": ""
},
{
"size": "100",
"name": ""
}
],
"unknown_rank": false
},
"name": "detection_classes:0"
},
"num_detections": {
"dtype": "DT_FLOAT",
"tensor_shape": {
"dim": [
{
"size": "-1",
"name": ""
}
],
"unknown_rank": false
},
"name": "num_detections:0"
},
"detection_boxes": {
"dtype": "DT_FLOAT",
"tensor_shape": {
"dim": [
{
"size": "-1",
"name": ""
},
{
"size": "100",
"name": ""
},
{
"size": "4",
"name": ""
}
],
"unknown_rank": false
},
"name": "detection_boxes:0"
},
"detection_scores": {
"dtype": "DT_FLOAT",
"tensor_shape": {
"dim": [
{
"size": "-1",
"name": ""
},
{
"size": "100",
"name": ""
}
],
"unknown_rank": false
},
"name": "detection_scores:0"
}
},
"method_name": "tensorflow/serving/predict"
}
}
}
}
}
this is an example of how to encode the image that was used in ml enabler: pasting for reference later: https://github.com/developmentseed/ml-enabler/blob/master/lambda/download_and_predict/tensorflow.py
closing since we are switching to MDv5
I'm getting two cryptic errors when trying to serve a tfserving model for megadetector.
I went ahead and copied the model checkpoint and tfserving .pb model file to the TFServing directory format like we discussed.
Files are hosted here: https://github.com/microsoft/CameraTraps/blob/main/megadetector.md#download-links
And I’m testing the TFServing container that was built by Sagemaker which I cloned from ECR (found this from the deploy megadetector notebook hosted on the megadetector Sagemaker Notebook Instance):
Finally I renamed files in the downloaded model checkpoint directory from model.ckpt to variables
After starting the service with all the above prep, I’m getting a new error :