MLS-C01 Question 200
Select 3You are building an image classification model using Amazon SageMaker and want to use a pre-trained ResNet model to initialize your training process. Which of the following steps is required to properly initialize the pre-trained model within SageMaker?
- A
Use the SageMaker pre-built image for TensorFlow or PyTorch and load the ResNet weights from a public model zoo.
- B
Modify the training script to include code for downloading and loading the pre-trained ResNet model weights.
- C
Set the 'initial_weights' parameter in the SageMaker Estimator to the location of the pre-trained ResNet weights.
- D
Ensure your training data matches the input size and format expected by the pre-trained ResNet model.
- E
Enable distributed training in SageMaker to ensure proper initialization of the pre-trained model.
Show answer and explanation
Correct answers: A, B, D
Explanation
To initialize a pre-trained model like ResNet in Amazon SageMaker, you need to use a pre-built SageMaker image for the appropriate framework (TensorFlow or PyTorch) and modify your training script to download and load the pre-trained weights. Additionally, you must ensure that your input data matches the size and format expected by the pre-trained model. These steps ensure that the model is correctly initialized and ready for fine-tuning or transfer learning.
- A. Correct.
Correct. SageMaker pre-built images for frameworks like TensorFlow or PyTorch provide the necessary environment to load pre-trained models such as ResNet from public model zoos.
- B. Correct.
Correct. You must include code in your training script to download and load the pre-trained weights for ResNet into the model before training begins.
- C. Incorrect.
Incorrect. The 'initial_weights' parameter does not exist in the SageMaker Estimator; you need to handle pre-trained weights directly in the training script.
- D. Correct.
Correct. Pre-trained models like ResNet expect input data to be in a specific size and format (e.g., 224x224 RGB images), so you must ensure your data pipeline aligns with these requirements.
- E. Incorrect.
Incorrect. While distributed training is useful for scaling training workloads, it is not required for initializing a pre-trained model.