Skip to content

fix: make PyTorch empty framework_version warning include the latest PyTorch version #1209

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 1 commit into from
Jan 6, 2020
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
4 changes: 2 additions & 2 deletions src/sagemaker/pytorch/estimator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
Expand Down Expand Up @@ -104,7 +104,7 @@ def __init__(
:class:`~sagemaker.estimator.EstimatorBase`.
"""
if framework_version is None:
logger.warning(empty_framework_version_warning(PYTORCH_VERSION, PYTORCH_VERSION))
logger.warning(empty_framework_version_warning(PYTORCH_VERSION, self.LATEST_VERSION))
self.framework_version = framework_version or PYTORCH_VERSION

if "enable_sagemaker_metrics" not in kwargs:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_pytorch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
Expand Down Expand Up @@ -529,7 +529,7 @@ def test_empty_framework_version(warning, sagemaker_session):
)

assert estimator.framework_version == defaults.PYTORCH_VERSION
warning.assert_called_with(defaults.PYTORCH_VERSION, defaults.PYTORCH_VERSION)
warning.assert_called_with(defaults.PYTORCH_VERSION, estimator.LATEST_VERSION)


def test_pt_enable_sm_metrics(sagemaker_session):
Expand Down