File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -237,10 +237,11 @@ Saving models
237237In order to save your trained Chainer model for deployment on SageMaker, your training script should save your model
238238to a certain filesystem path called `model_dir `. This value is accessible through the environment variable
239239``SM_MODEL_DIR ``. The following code demonstrates how to save a trained Chainer model named ``model `` as
240- ``model.npz `` at the :
240+ ``model.npz `` at the end of training :
241241
242242.. code :: python
243- import chainer
243+
244+ import chainer
244245 import argparse
245246 import os
246247
@@ -249,7 +250,7 @@ import chainer
249250 parser.add_argument(' --model-dir' , type = str , default = os.environ[' SM_MODEL_DIR' ])
250251 args, _ = parser.parse_known_args()
251252
252- # ... train `model `, then save it to `model_dir `
253+ # ... train `model`, then save it to `model_dir` as file 'model.npz'
253254 chainer.serializers.save_npz(os.path.join(args.model_dir, ' model.npz' ), model)
254255
255256 After your training job is complete, SageMaker will compress and upload the serialized model to S3, and your model data
You can’t perform that action at this time.
0 commit comments