‘no SavedModel bundles found!’ on tensorflow_hub model deployment to AWS SageMaker

Question:

I attempting to deploy the universal-sentence-encoder model to a aws Sagemaker endpoint and am getting the error raise ValueError('no SavedModel bundles found!')

I have shown my code below, I have a feeling that one of my paths is incorrect

Answer:

I suppose you started from this example? https://github.com/awslabs/amazon-sagemaker-examples/tree/master/sagemaker-python-sdk/tensorflow_serving_container

It looks like you’re not saving the TF Serving bundle properly: the model version number is missing, because of this line:

Replacing it with this should fix your problem:

Your model artefact should look like this (I used the model in the notebook above):

Then, upload to S3 and deploy.

Leave a Reply