aws-samples / amazon-sagemaker-tensorflow-object-detection-api

Train and deploy models using TensorFlow 2 with the Object Detection API on Amazon SageMaker
MIT No Attribution
45 stars 34 forks source link

Error deploying with TensorFlowModel #22

Closed Abd-elr4hman closed 2 years ago

Abd-elr4hman commented 2 years ago

Hi, I tried the deployment part with the EfficientDet model from tf2 object detection api directly without fine tuning it, and whenever i try to call model.deploy() it takes a long time and then gives me the following error:

UnexpectedStatusException: Error hosting endpoint tf2-object-detection-2022-05-28-10-46-50-583: Failed. Reason:
The customer:primary container for production variant AllTraffic did not pass the ping health check.
Please check CloudWatch logs for this endpoint..

Q: Can i use the tf2 object detection api model directly without tuning it with sagemaker.tensorflow.serving.Model.TensorFlowModel ?

Thanks in advance!

Abd-elr4hman commented 2 years ago

so the problem was the folder structure of the pretrained model... you have to name the top file as a number so that it is recognized as the model version

some_name 
    |__ Some positive number that represents version (For eg: 1) 
            |__ saved_model.pb 
            |__ variables 
                    |__ (Non empty)

as explained in here https://prameshbajra.github.io/aws/sagemaker/prediction/detection/tensorflow/numpy/data/images/code/programming/deployment/s3/cloudwatch/2019/10/13/deploy_in_sagemaker.html

that should solve it