Skip to content

fix code formatting for chainer readme #214

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 6 commits into from
Jun 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/sagemaker/chainer/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,11 @@ Saving models
In order to save your trained Chainer model for deployment on SageMaker, your training script should save your model
to a certain filesystem path called `model_dir`. This value is accessible through the environment variable
``SM_MODEL_DIR``. The following code demonstrates how to save a trained Chainer model named ``model`` as
``model.npz`` at the :
``model.npz`` at the end of training:

.. code:: python
import chainer

import chainer
import argparse
import os

Expand All @@ -249,7 +250,7 @@ import chainer
parser.add_argument('--model-dir', type=str, default=os.environ['SM_MODEL_DIR'])
args, _ = parser.parse_known_args()

# ... train `model`, then save it to `model_dir`
# ... train `model`, then save it to `model_dir` as file 'model.npz'
chainer.serializers.save_npz(os.path.join(args.model_dir, 'model.npz'), model)

After your training job is complete, SageMaker will compress and upload the serialized model to S3, and your model data
Expand Down