Repository navigation
Description
Please fill out the form below.
System Information
- Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans):
Any Framework Container - Python Version:
2 and 3 - Python SDK Version:
1.12
Describe the problem
Issue found by @andrewcking here #402
In SageMaker Hosting, the process to create an endpoint requires to create an model, an endpoint configuration, and an endpoint.
SageMaker Python SDK abstract these 3 layers for you. These are the lines where this process happens
container_def = self.prepare_container_def(instance_type)
self.name = self.name or name_from_image(container_def['Image'])
self.sagemaker_session.create_model(self.name, self.role, container_def, vpc_config=self.vpc_config)
production_variant = sagemaker.production_variant(self.name, instance_type, initial_instance_count)
self.endpoint_name = endpoint_name or self.name
self.sagemaker_session.endpoint_from_production_variants(self.endpoint_name, [production_variant], tags)To be able to use Python SDK to create an endpoint with the same name, you will have to delete the model, the endpoint_config, and the endpoint. SageMaker Python SDK delete_endpoint() only deletes the endpoint, which is why the issue is happening.
Minimal repro / logs
Please provide any logs and a bare minimum reproducible test case, as this will be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
- Exact command to reproduce:
from sagemaker.pytorch import PyTorch
# create estimator
estimator = PyTorch(entry_point='train.py',
role='SageMakerRole',
framework_version='0.4.0',
train_instance_count=1,
train_instance_type='ml.c5.xlarge',
source_dir='source',
hyperparameters={'epochs': 6,})
# fit estimator
estimator.fit('s3://sagemaker-sample-data-us-west-2/spark/mnist/train/')
# deploy estimator (except it doesn't deploy your new estimator if a previously used endpoint name is specified)
estimator.deploy(instance_type='ml.c5.xlarge'', initial_instance_count=1)
# delete endpoint
estimator.delete_endpoint()
# deploy again
estimator.deploy(instance_type='ml.c5.xlarge'', initial_instance_count=1, endpoint_name=estimator.last_training_job.name)
Activity
Merge pull request aws#447 from awslabs/mvs-hpo-fix
ChoiByungWook commentedon Feb 13, 2019
These features are being worked on in the following PRs:
The ability to delete endpoint configurations has been merged.
chuyang-deng commentedon Feb 22, 2019
The change has been merged, waiting on release.