- Newest
- Most votes
- Most comments
There were 3 issues
- /usr/bin/serve file missing,
- Model not properly copied to /opt/ml/model because of” / “missing
- my custom script was in /opt/ml instead of /opt/ml/code
answered 2 years ago
When a SageMaker endpoint creation fails for a custom container, especially with serverless inference, there are several potential issues to consider:
-
Container permissions: If you're using a container that was previously used for instance-based endpoints, it may lack the necessary permissions to write files in the serverless environment. This can lead to ping health check failures or permission errors.
-
Container structure: Ensure that your inference code (typically 'inference.py') is located in a 'code/' subfolder within your model tarball. Incorrect file structure can cause deployment issues.
-
Model artifact packaging: When creating your model tarball, make sure it extracts correctly to the current directory and doesn't create unexpected subfolders.
-
CloudWatch logs: The lack of logs could be due to buffering. Try setting the environment variable "PYTHONUNBUFFERED" to "1" when creating your model to disable Python log buffering. This can help ensure logs are written before a process crashes.
-
Endpoint configuration: Check that previous models and endpoint configurations are actually being deleted and not accidentally reused when you're trying different setups.
-
Local testing: To save time, consider testing your inference code locally before deploying. You can use SageMaker Local Mode with 'instance_type='local'' to test the entire stack in a Docker environment.
-
IAM roles and permissions: Although you've checked the IAM and execution roles, double-check that the role has all necessary permissions, including access to any required AWS services (like S3 for model artifacts).
-
Container health check: Ensure your container can respond to the health check requests SageMaker sends. This is crucial for successful deployment.
If the issue persists, you may need to add more verbose logging in your inference code to capture any errors occurring during the container startup or model loading process. This can help identify the root cause of the failure when logs become available.
Sources
Model error of deployed sageMaker Endpoint | AWS re:Post
Troubleshooting - Amazon SageMaker AI
answered 2 years ago
