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
237
237
In order to save your trained Chainer model for deployment on SageMaker, your training script should save your model
238
238
to a certain filesystem path called `model_dir `. This value is accessible through the environment variable
239
239
``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 :
241
241
242
242
.. code :: python
243
- import chainer
243
+
244
+ import chainer
244
245
import argparse
245
246
import os
246
247
@@ -249,7 +250,7 @@ import chainer
249
250
parser.add_argument(' --model-dir' , type = str , default = os.environ[' SM_MODEL_DIR' ])
250
251
args, _ = parser.parse_known_args()
251
252
252
- # ... train `model `, then save it to `model_dir `
253
+ # ... train `model`, then save it to `model_dir` as file 'model.npz'
253
254
chainer.serializers.save_npz(os.path.join(args.model_dir, ' model.npz' ), model)
254
255
255
256
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