Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Sagemaker Deploy fails

I am following the sage maker documentation to train and deploy an ML model. I am using the high-level Python library provided by Amazon SageMaker to achieve this.

kmeans_predictor = kmeans.deploy(initial_instance_count=1,
                                 instance_type='ml.m4.xlarge')

The deployment fails with error

ResourceLimitExceeded: An error occurred (ResourceLimitExceeded) when calling the CreateEndpoint operation: The account-level service limit 'ml.c4.8xlarge for endpoint usage' is 0 Instances, with current utilization of 0 Instances and a request delta of 1 Instances.

Where am I going wrong?

like image 404
Merl Avatar asked Dec 03 '18 13:12

Merl


People also ask

What are the limitations of SageMaker?

SageMaker does not allow you to schedule training jobs. SageMaker does not provide a mechanism for easily tracking metrics logged during training. We often fit feature extraction and model pipelines. We can inject the model artifacts into AWS-provided containers, but we cannot inject the feature extractors.

Will I continue incurring charges for a stopped SageMaker notebook?

You must shut down the instance to stop incurring charges. If you shut down the notebook running on the instance but don't shut down the instance, you will still incur charges.

Does SageMaker need ECR?

Amazon SageMaker currently requires Docker images to reside in Amazon ECR. To push an image to ECR, and not the central Docker registry, you must tag it with the registry hostname. Unlike Docker Hub, Amazon ECR images are private by default, which is a good practice with Amazon SageMaker.


2 Answers

Answer

Under free_tier AWS account, use 'InstanceType':'ml.t2.medium' to successfully deploy a machine learning model. By default, if you are following AWS tutorials online, you will end up using 'ml.m4.xlarge' which leads to this error.

Therefore, use 'InstanceType':'ml.t2.medium' instead of 'ml.m4.xlarge' instance in code spinets shown in the image below.

The error is due to account-level service limit. Free_tier account get the error when using EC2 instance type 'ml.m4.xlarge'.Therefore, use 'ml.t2.medium' instead of ml.m4.xlarge'. Usually, while creating AWS endpoint, free_account holders get below error:

ResourceLimitExceeded: An error occurred (ResourceLimitExceeded) when calling the CreateEndpoint operation: The account-level service limit 'ml.m4.xlarge for endpoint usage' is 0 Instances, with current utilization of 0 Instances and a request delta of 1 Instances. Please contact AWS support to request an increase for this limit.

CODE Change to successfully deploy machine learning model on AWS:

enter image description here

like image 151
DataFramed Avatar answered Sep 28 '22 08:09

DataFramed


I resolved the issue by changing the instance type:

kmeans_predictor = kmeans.deploy(initial_instance_count=1,
                                 instance_type='ml.t2.medium')
like image 38
Merl Avatar answered Sep 28 '22 08:09

Merl