@@ -263,6 +263,66 @@ A few important notes:
263
263
- Local Mode requires Docker Compose and `nvidia- docker2 < https:// github.com/ NVIDIA / nvidia- docker> ` __ for `` local_gpu`` .
264
264
- Distributed training is not yet supported for `` local_gpu`` .
265
265
266
+ Incremental Training
267
+ ~~~~~~~~~~~~~~~~~~~~
268
+
269
+ Incremental training allows you to bring a pre- trained model into a SageMaker training job and use it as a starting point for a new model.
270
+ There are several situations where you might want to do this:
271
+
272
+ - You want to perform additional training on a model to improve its fit on your data set .
273
+ - You want to import a pre- trained model and fit it to your data.
274
+ - You want to resume a training job that you previously stopped.
275
+
276
+ To use incremental training with SageMaker algorithms, you need model artifacts compressed into a `` tar.gz`` file . These
277
+ artifacts are passed to a training job via an input channel configured with the pre- defined settings Amazon SageMaker algorithms require.
278
+
279
+ To use model files with a SageMaker estimator, you can use the following parameters:
280
+
281
+ * `` model_uri`` : points to the location of a model tarball, either in S3 or locally. Specifying a local path only works in local mode.
282
+ * `` model_channel_name`` : name of the channel SageMaker will use to download the tarball specified in `` model_uri`` . Defaults to ' model' .
283
+
284
+ This is converted into an input channel with the specifications mentioned above once you call `` fit()`` on the predictor.
285
+ In bring- your- own cases, `` model_channel_name`` can be overriden if you require to change the name of the channel while using
286
+ the same settings.
287
+
288
+ If your bring- your- own case requires different settings, you can create your own `` s3_input`` object with the settings you require.
289
+
290
+ Here' s an example of how to use incremental training:
291
+
292
+ .. code:: python
293
+ # Configure an estimator
294
+ estimator = sagemaker.estimator.Estimator(training_image,
295
+ role,
296
+ train_instance_count = 1 ,
297
+ train_instance_type = ' ml.p2.xlarge' ,
298
+ train_volume_size = 50 ,
299
+ train_max_run = 360000 ,
300
+ input_mode = ' File' ,
301
+ output_path = s3_output_location)
302
+
303
+ # Start a SageMaker training job and waits until completion.
304
+ estimator.fit(' s3://my_bucket/my_training_data/' )
305
+
306
+ # Create a new estimator using the previous' model artifacts
307
+ incr_estimator = sagemaker.estimator.Estimator(training_image,
308
+ role,
309
+ train_instance_count = 1 ,
310
+ train_instance_type = ' ml.p2.xlarge' ,
311
+ train_volume_size = 50 ,
312
+ train_max_run = 360000 ,
313
+ input_mode = ' File' ,
314
+ output_path = s3_output_location,
315
+ model_uri = estimator.model_data)
316
+
317
+ # Start a SageMaker training job using the original model for incremental training
318
+ incr_estimator.fit(' s3://my_bucket/my_training_data/' )
319
+
320
+ Currently, the following algorithms support incremental training:
321
+
322
+ - Image Classification
323
+ - Object Detection
324
+ - Semantics Segmentation
325
+
266
326
267
327
MXNet SageMaker Estimators
268
328
--------------------------
0 commit comments