How to start training a job from existing model.
I am using Tensorflow to train a default MNIST data, the model will be uploaded in S3. After a while, we collect more user's handwritten digits. How can I retrain the existing model that was previously trained using SageMaker Tensorflow(trained with default MNIST data) with the new user's data?
I'm not sure if this is what you mean, but if you want to "continue" a training job from checkpoint, set the argument checkpoint_path in your TF Estimator where your last check_point exists. From what I can tell this is what you mean by "retrain" - you are updating the model weights based off new data.
From the Estimator code you can see checkpoint_path is defined as follows:checkpoint_path (str): Identifies S3 location where checkpoint data during model training can be saved (default: None). For distributed model training, this parameter is required.
Thank Samuel! That's exactly what I need. It works.
However there is an issue with loading the existing checkpoint with training_steps param set at a fix value. For example: First round training, the checkpoint at global_steps=10000 will be stored: mnist_estimator = TensorFlow( entry_point='...', checkpoint_path = checkpoint_path, training_steps=10000, evaluation_steps=10, ...) mnist_estimator.fit(inputs1, wait = True)
Second round of training with different inputs2 mnist_estimator = TensorFlow( entry_point='...', checkpoint_path = checkpoint_path, training_steps=10000, evaluation_steps=10, ...) mnist_estimator.fit(inputs2, wait = True) The training does not seems to run addtional 10000 steps but look like it is compared with global_steps and finish the training.
@milodeptrai - I believe that's a TensorFlow issue as global_step is also stored in the checkpoint. I think this is by design.
Hey @milodeptrai. Is that still an issue for you?
Closing due to lack of response. Feel free to reopen if necessary!