MLA-C01 Question 274
Single answerYou are tasked with deploying a machine learning model to production using Amazon SageMaker. The model requires a specific version of TensorFlow and custom preprocessing logic that is not included in SageMaker's pre-built containers. Which container option would be most appropriate for this scenario?
- A
Use a SageMaker-provided TensorFlow container
- B
Build a custom container with the required TensorFlow version and preprocessing logic
- C
Use a SageMaker-provided PyTorch container and add the preprocessing logic as a script
- D
Deploy the model without a container and handle preprocessing outside of SageMaker
Show answer and explanation
Correct answer: B
Explanation
In scenarios where the required framework version or additional dependencies are not available in the SageMaker-provided containers, creating a custom container is the most appropriate approach. Custom containers allow you to fully control the environment, including the framework version and any additional logic or libraries needed.
- A. Incorrect.
SageMaker-provided containers are convenient but only support the versions and features included by AWS. Since a specific TensorFlow version and custom preprocessing logic are required, this option is not sufficient.
- B. Correct.
Building a custom container allows you to include the exact TensorFlow version and custom preprocessing logic, making it the best option for this scenario.
- C. Incorrect.
Using a SageMaker-provided PyTorch container is not suitable since the requirement specifies TensorFlow, and SageMaker-provided containers do not support significant customization.
- D. Incorrect.
SageMaker requires a container for deploying models. Handling preprocessing outside of SageMaker would lead to additional complexity, making this option impractical.