Skip to content

fix: update documentation link in warning message #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/sagemaker_tensorflow_container/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,18 @@ def _log_model_missing_warning(model_dir):
pb_file_exists = True
path, direct_parent_dir = os.path.split(dirpath)
if not str.isdigit(direct_parent_dir):
logger.warn('Your model will NOT be servable with SageMaker TensorFlow Serving containers.'
logger.warn('Your model will NOT be servable with SageMaker TensorFlow Serving containers. '
'The SavedModel bundle is under directory \"{}\", not a numeric name.'
.format(direct_parent_dir))

if not file_exists:
logger.warn('No model artifact is saved under path {}.'
' Your training job will not save any model files to S3.\n'
'For details of how to construct your training script see:\n'
'https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/tensorflow#adapting-your-local-tensorflow-script' # noqa
'https://sagemaker.readthedocs.io/en/stable/using_tf.html#adapting-your-local-tensorflow-script'
.format(model_dir))
elif not pb_file_exists:
logger.warn('Your model will NOT be servable with SageMaker TensorFlow Serving container.'
logger.warn('Your model will NOT be servable with SageMaker TensorFlow Serving container. '
'The model artifact was not saved in the TensorFlow SavedModel directory structure:\n'
'https://www.tensorflow.org/guide/saved_model#structure_of_a_savedmodel_directory')

Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ def test_log_model_missing_warning_no_model(logger):
logger.warn.assert_called_with('No model artifact is saved under path {}.'
' Your training job will not save any model files to S3.\n'
'For details of how to construct your training script see:\n'
'https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/tensorflow#adapting-your-local-tensorflow-script' # noqa
'https://sagemaker.readthedocs.io/en/stable/using_tf.html#adapting-your-local-tensorflow-script' # noqa
.format(path))


@patch('sagemaker_tensorflow_container.training.logger')
def test_log_model_missing_warning_wrong_format(logger):
training._log_model_missing_warning(os.path.join(RESOURCE_PATH, 'test_dir_wrong_model'))
logger.warn.assert_called_with('Your model will NOT be servable with SageMaker TensorFlow Serving container.'
logger.warn.assert_called_with('Your model will NOT be servable with SageMaker TensorFlow Serving container. '
'The model artifact was not saved in the TensorFlow '
'SavedModel directory structure:\n'
'https://www.tensorflow.org/guide/saved_model#structure_of_a_savedmodel_directory')
Expand All @@ -225,7 +225,7 @@ def test_log_model_missing_warning_wrong_format(logger):
@patch('sagemaker_tensorflow_container.training.logger')
def test_log_model_missing_warning_wrong_parent_dir(logger):
training._log_model_missing_warning(os.path.join(RESOURCE_PATH, 'test_dir_wrong_parent_dir'))
logger.warn.assert_called_with('Your model will NOT be servable with SageMaker TensorFlow Serving containers.'
logger.warn.assert_called_with('Your model will NOT be servable with SageMaker TensorFlow Serving containers. '
'The SavedModel bundle is under directory \"{}\", not a numeric name.'
.format('not-digit'))

Expand Down