MLA-C01 Question 194
Select 3You are working as a Machine Learning Engineer and need to deploy a custom-trained TensorFlow model built outside of Amazon SageMaker. The model is stored as a TensorFlow SavedModel format in an S3 bucket. You want to host this model using SageMaker so it can serve real-time predictions. Which methods can you use to integrate this model into SageMaker?
- A
Use the SageMaker Python SDK to create a
TensorFlowModelobject pointing to the model in S3, and deploy it directly to an endpoint. - B
Convert the TensorFlow model to Amazon SageMaker Neo format before deploying it using the Neo runtime.
- C
Upload the TensorFlow model to an Amazon EFS volume, and directly point to it during SageMaker endpoint deployment.
- D
Use SageMaker's pre-built TensorFlow containers to deploy the model by specifying the model artifact's S3 path.
- E
Package the TensorFlow model into a Docker container, upload it to Amazon ECR, and deploy it as a custom SageMaker model.
Show answer and explanation
Correct answers: A, D, E
Explanation
To integrate a TensorFlow model trained outside SageMaker into SageMaker, you can use several methods. The SageMaker Python SDK provides direct support for TensorFlow models through the TensorFlowModel class, which allows deployment from S3. Additionally, SageMaker's pre-built TensorFlow containers simplify deployment by enabling the use of model artifacts stored in S3. For more advanced use cases requiring custom dependencies or inference logic, you can package the model into a Docker container and deploy it via Amazon ECR. Other options, like using EFS or converting to SageMaker Neo format, are not standard or necessary for this scenario.
- A. Correct.
Correct: The SageMaker Python SDK supports deploying TensorFlow models directly using the
TensorFlowModelclass. This is a straightforward way to deploy a TensorFlow model stored in S3. - B. Incorrect.
Incorrect: Converting the model to SageMaker Neo format is unnecessary unless optimization for specific hardware is required. This step is not directly related to integrating an externally trained model.
- C. Incorrect.
Incorrect: SageMaker does not directly support deploying models from EFS volumes. Models must be stored in S3 or packaged in a Docker container for custom hosting.
- D. Correct.
Correct: SageMaker provides pre-built TensorFlow containers that allow deployment of models stored in S3. This is a common method for deploying externally trained TensorFlow models.
- E. Correct.
Correct: Packaging the model into a Docker container and uploading it to Amazon ECR is a valid approach for deploying custom models in SageMaker. This is useful when you need custom dependencies or a custom inference script.