Skip to content

Specify location for repacked model data #1402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
harusametime opened this issue Apr 10, 2020 · 1 comment
Closed

Specify location for repacked model data #1402

harusametime opened this issue Apr 10, 2020 · 1 comment

Comments

@harusametime
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When users are not allowed to create S3 bucket, they need to specify S3 bucket that they can access. For training, we can set output_path in estimator for specifying location for storing source code and a trained model.

However, calling estimator.deploy() repacks the source code and the trained model, and tries to upload to default bucket, named sagemaker-<region name>-<account_id>. If a user is not allowed to access the S3 bucket, SageMaker fails to deploy.

Reading model.py#L852, we need to overwrite model.bucket. Actually, the following code works, but is not easy for users.

model = estimator.create_model()
model.bucket = "accessible-bucket-name"
predictor = model.deploy(...)

Describe the solution you'd like

  • For estimator, output_path should be used for repacked model data. A user need not to specify the accessible bucket name again.
  • For create_model() or model.deploy(), an argument to specify a location for repacked model would be convenient.
@knakad
Copy link
Contributor

knakad commented Apr 10, 2020

Hi Masaki!

We actually received this as a feature request already in #1258 and I added new functionality to support this use-case =)

There are two ways you can change your code to resolve this:

  • (Recommended) Created your session as follows, by specifying the default_bucket that already exists (if it doesn't exist, sagemaker-python-sdk will attempt to create it for you):
sagemaker_session = sagemaker.session.Session(default_bucket='my-bucket')
  • You can override the bucket location for this specific issue by specifying the code_location in the estimator.

Hope that helps!!

Reopen and reach out if you're still having trouble :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants