- Newest
- Most votes
- Most comments
The error you're encountering is related to the model registration step in your SageMaker pipeline. The issue is with the S3 URI format in your ModelMetrics configuration.
When using RegisterModel in a SageMaker pipeline with SDK version 2.90.0 or later, there are specific requirements for how you reference S3 URIs. The error indicates that the S3 URI format you're using for model metrics doesn't match the expected pattern.
Instead of directly specifying the S3 URI as a string with formatting, you should reference the output from your evaluation step. Here's how you can fix your code:
model_metrics = ModelMetrics( model_statistics=MetricsSource( s3_uri=evaluation_step.properties.ProcessingOutputConfig.Outputs["evaluation"].S3Output.S3Uri + "/evaluation.json", content_type="application/json" ) )
This approach uses the properties from your evaluation step to dynamically reference the S3 location where your evaluation results are stored.
If you continue to face issues with RegisterModel in your pipeline, you might consider using ModelStep instead, as it's the recommended approach for model registration in newer versions of the SageMaker SDK. Alternatively, you could use Boto3 or SageMaker Studio to register your model.
Sources
Troubleshoot model registry issues in SageMaker AI | AWS re:Post
Add a step - Amazon SageMaker AI
answered a year ago
Relevant content
asked 4 years ago
asked 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
