Skip to content

Add docs on TensorFlowModel class usage + requirements file for serving #393

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

Merged
merged 2 commits into from
Sep 19, 2018

Conversation

winstonaws
Copy link
Contributor

@winstonaws winstonaws commented Sep 18, 2018

Issue #, if available:

Description of changes:
Add docs on TensorFlowModel usage (deploying directly from model artifacts).

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have updated the changelog with a description of my changes (if appropriate)
  • I have updated any necessary documentation (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@winstonaws winstonaws requested a review from laurenyu September 18, 2018 22:32
Copy link
Contributor

@laurenyu laurenyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few small suggestions - overall looks good


predictor = tf_model.deploy(initial_instance_count=1, instance_type='ml.c4.xlarge')

You can also optionally specify a pip requirements if you need to install additional packages into the deployed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/requirements/requirements file - might also be helpful to link to something like https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, done

predictor = tf_model.deploy(initial_instance_count=1, instance_type='ml.c4.xlarge')

You can also optionally specify a pip requirements if you need to install additional packages into the deployed
runtime environment by including it in your source_dir and specifying it in the 'SAGEMAKER_REQUIREMENTS' env variable:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd make 'SAGEMAKER_REQUIREMENTS' monospaced

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

source_dir='my_src', # directory which contains entry_point script and requirements file
name='model_name',
env={'SAGEMAKER_REQUIREMENTS': 'requirements.txt'} # path relative to source_dir
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd put the closing parenthesis on the previous line to be consistent with the other code snippet

@codecov-io
Copy link

Codecov Report

Merging #393 into master will increase coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
+ Coverage   92.94%   93.11%   +0.16%     
==========================================
  Files          51       51              
  Lines        3572     3572              
==========================================
+ Hits         3320     3326       +6     
+ Misses        252      246       -6
Impacted Files Coverage Δ
src/sagemaker/local/image.py 89.22% <0%> (+1.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb184cb...f384570. Read the comment docs.

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #393 into master will increase coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
+ Coverage   92.94%   93.11%   +0.16%     
==========================================
  Files          51       51              
  Lines        3572     3572              
==========================================
+ Hits         3320     3326       +6     
+ Misses        252      246       -6
Impacted Files Coverage Δ
src/sagemaker/local/image.py 89.22% <0%> (+1.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb184cb...f384570. Read the comment docs.

@winstonaws winstonaws merged commit 597ced1 into aws:master Sep 19, 2018
@winstonaws winstonaws deleted the docs_serving_requirements branch September 19, 2018 17:10
pdasamzn pushed a commit to pdasamzn/sagemaker-python-sdk that referenced this pull request Nov 1, 2018
…ng (aws#393)

* Add docs on TensorFlowModel class usage + requirements file for serving

* PR updates
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

Successfully merging this pull request may close these issues.

3 participants