0

I am following this example from aws https://github.com/aws-samples/sagemaker-multi-model-endpoint-tensorflow-computer-vision/blob/main/multi-model-endpoint-tensorflow-cv.ipynb to apply same workflow with two pre trained models (trained outside of sagemaker).

But when I do the following, logs say that models can't be found:

import boto3
import datetime
from datetime import datetime
import time
import sagemaker
from sagemaker import get_execution_role
from sagemaker.tensorflow.serving import TensorFlowModel
from sagemaker.multidatamodel import MultiDataModel

model_data_prefix = f's3://{BUCKET}/{PREFIX}/mme/'
output = f's3://{BUCKET}/{PREFIX}/mme/test.tar.gz'

modele = TensorFlowModel(model_data=output, 
                          role=role, 
                          image_uri=IMAGE_URI)

mme = MultiDataModel(name=f'mme-tensorflow-{current_time}',
                     model_data_prefix=model_data_prefix,
                     model=modele,
                     sagemaker_session=sagemaker_session)

predictor = mme.deploy(initial_instance_count=1,
                       instance_type='ml.m5.2xlarge',
                       endpoint_name=f'mme-tensorflow-{current_time}')

When I give an image as input to predict, I have this message:

ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (500) from model with message "<html>
  <head>
    <title>Internal Server Error</title>
  </head>
  <body>
    <h1><p>Internal Server Error</p></h1>
    
  </body>
</html>
".

Logs give:

Could not find base path /opt/ml/models/.../model for servable ...

What did I missed ?

2 Answers 2

1

In the sample notebook, the model is trained within SageMaker. So it is created with certain environment variables like the "SAGEMAKER_PROGRAM"(I think, need to check the documentation) with value set to entry point script.

But while you are creating the model with models trained outside the SageMaker you need to add those environment variables.

Without an entry point script SageMaker is not in a position to know what to do with the request.

Sign up to request clarification or add additional context in comments.

Comments

0

SageMaker supports deployment of multiple deep learning models on GPUs using NVIDIA Triton inference server. You can bring models trained outside SageMaker and deploy with SageMaker MME using triton model configuration and model repository. Refer to documentation, examples and blog to get started

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.