aws-samples/amazon-sagemaker-script-mode

Replace global reference with a local variable in example script

Closed this issue · 1 comments

There is a function in one of the SageMaker's examples that saves Keras model onto disk:

def save_model(model, output):
    tf.contrib.saved_model.save_keras_model(model, args.model_dir)
    logging.info("Model successfully saved at: {}".format(output))
    return

But it seems that the function doesn't use output variable and refers global args.model_dir instead.

How do you think, should this function be replaced with something like this?

def save_model(model, output):
    tf.contrib.saved_model.save_keras_model(model, output)
    logging.info("Model successfully saved at: {}".format(output))

Yes, agreed the function should be modified along those lines. Thanks for pointing this out!