-
Notifications
You must be signed in to change notification settings - Fork 1.2k
doc: start v2 usage and migration documentation #1553
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ Overview | |
:maxdepth: 2 | ||
|
||
overview | ||
v2 | ||
|
||
The SageMaker Python SDK APIs: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
################################## | ||
Use v2 of the SageMaker Python SDK | ||
################################## | ||
|
||
Development on v2.0.0 of the SageMaker Python SDK is underway. | ||
For more info on our plans, see https://github.com/aws/sagemaker-python-sdk/issues/1459. | ||
|
||
.. contents:: | ||
:local: | ||
|
||
************ | ||
Installation | ||
************ | ||
|
||
.. warning:: | ||
v2 is currently experimental, so proceed with caution. If you do run into issues or have any other feedback, | ||
please let us know by `opening an issue <https://github.com/aws/sagemaker-python-sdk/issues/new/choose>`_ | ||
or `commenting on our planning issue <https://github.com/aws/sagemaker-python-sdk/issues/1459>`_. | ||
|
||
To install the latest release candidate: | ||
|
||
.. code:: bash | ||
|
||
pip install [email protected]:aws/[email protected] | ||
|
||
To install the latest version of v2: | ||
|
||
.. code:: bash | ||
|
||
pip install [email protected]:aws/sagemaker-python-sdk.git@zwei | ||
|
||
If you are executing this pip install command in a notebook, make sure to restart your kernel. | ||
|
||
******* | ||
Changes | ||
******* | ||
|
||
To see what changes have been made, see the `CHANGELOG <https://github.com/aws/sagemaker-python-sdk/blob/zwei/CHANGELOG.md>`_. | ||
|
||
******************************* | ||
Automatically Upgrade Your Code | ||
******************************* | ||
|
||
To help make your transition as seamless as possible, v2 of the SageMaker Python SDK comes with a command-line tool to automate updating your code. | ||
It automates as much as possible, but there are still syntactical and stylistic changes that cannot be performed by the script. | ||
|
||
.. warning:: | ||
While the tool is intended to be easy to use, we recommend using it as part of a process that includes testing before and after you run the tool. | ||
|
||
Usage | ||
===== | ||
|
||
Currently, the tool supports only converting one file at a time: | ||
|
||
.. code:: | ||
|
||
$ sagemaker-upgrade-v2 --in-file input.py --out-file output.py | ||
$ sagemaker-upgrade-v2 --in-file input.ipynb --out-file output.ipynb | ||
|
||
You can apply it to a set of files using a loop: | ||
|
||
.. code:: bash | ||
|
||
$ for file in $(find input-dir); do sagemaker-upgrade-v2 --in-file $file --out-file output-dir/$file; done | ||
|
||
Limitations | ||
=========== | ||
|
||
Aliased Imports | ||
--------------- | ||
|
||
The tool checks for a limited number of patterns when looking for constructors. | ||
For example, if you are using a TensorFlow estimator, only the following invocation styles are handled: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like I'd want to see a before and after example. After reading this, I'm still not sure what changed and how much work I'd have to do if I used an aliased import. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough. I'll populate the "Changes" section when I update the changelog in a new PR |
||
|
||
.. code:: python | ||
|
||
TensorFlow() | ||
sagemaker.tensorflow.TensorFlow() | ||
sagemaker.tensorflow.estimator.TensorFlow() | ||
|
||
If you have aliased an import, e.g. ``from sagemaker.tensorflow import TensorFlow as TF``, the tool does not take care of updating its parameters. | ||
|
||
TensorFlow Serving | ||
------------------ | ||
|
||
If you are using the ``sagemaker.tensorflow.serving.Model`` class, the tool does not take care of adding a framework version or changing it to ``sagemaker.tensorflow.TensorFlowModel``. |
Uh oh!
There was an error while loading. Please reload this page.