Skip to content

Can't pass new entry_point to estimator.deploy() #1427

@thomelane

Description

@thomelane

Describe the bug

Can't pass a new entry_point to estimator.deploy(). Only way is to set the entry_point property on the estimator first and then deploy. Unintuitive that entry_point would be ignored in deploy method.

To reproduce

estimator = sagemaker.sklearn.SKLearn(
    image_name=str(custom_image),
    source_dir=str(Path(current_folder, 'src').resolve()),
    entry_point='entry_point.py',
    hyperparameters=hyperparameters,
    role=config.SAGEMAKER_IAM_ROLE,
    train_instance_count=1,
    train_instance_type=train_instance_type,
    sagemaker_session=session,
    output_path='s3://' + str(Path(config.S3_BUCKET, config.OUTPUTS_S3_PREFIX)),
    code_location='s3://' + str(Path(config.S3_BUCKET, config.OUTPUTS_S3_PREFIX))
)
estimator.fit(...)
predictor = estimator.deploy(
    endpoint_name=endpoint_name,
    instance_type=deploy_instance_type,
    initial_instance_count=1,
    entry_point='another_entry_point.py'
)

Expected behavior

Would expect the deployed endpoint to use another_entry_point.py rather than entry_point.py.

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 1.55.3
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): SKLearn
  • Framework version: 0.20.0-cpu-py3
  • Python version: Python 3
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): Y (but extends SKLearn container from SM)

Additional context

Seems like the issue is that the kwarg for entry_point is removed and replaced with the property (from the training) instead. See https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/sklearn/estimator.py#L167. Should be able to override without having to set property on the estimator. Could effect other frameworks too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions