-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: update py2 warning message since python 2 is deprecated #1224
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
Changes from 3 commits
05df9b7
35ee1f5
2650374
4763545
43b481d
df3c7f6
a46d23f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ | |
SKLEARN_NAME = "scikit-learn" | ||
|
||
SKLEARN_VERSION = "0.20.0" | ||
|
||
LATEST_PY2_VERSION = "0.20.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
from sagemaker.debugger import DebuggerHookConfig | ||
from sagemaker.estimator import Framework | ||
import sagemaker.fw_utils as fw | ||
from sagemaker.tensorflow.defaults import TF_VERSION, LATEST_VERSION | ||
from sagemaker.tensorflow.defaults import TF_VERSION, LATEST_VERSION, LATEST_PY2_VERSION | ||
from sagemaker.tensorflow.model import TensorFlowModel | ||
from sagemaker.tensorflow.serving import Model | ||
from sagemaker.transformer import Transformer | ||
|
@@ -293,6 +293,10 @@ def __init__( | |
|
||
if not py_version: | ||
py_version = "py3" if self._only_python_3_supported() else "py2" | ||
if py_version == "py2": | ||
logger.warning( | ||
fw.python_deprecation_warning(self.__framework_name__, LATEST_PY2_VERSION) | ||
) | ||
|
||
if "enable_sagemaker_metrics" not in kwargs: | ||
# enable sagemaker metrics for TF v1.15 or greater: | ||
|
@@ -302,9 +306,6 @@ def __init__( | |
super(TensorFlow, self).__init__(image_name=image_name, **kwargs) | ||
self.checkpoint_path = checkpoint_path | ||
|
||
if py_version == "py2": | ||
logger.warning("tensorflow py2 container will be deprecated soon.") | ||
|
||
self.py_version = py_version | ||
self.training_steps = training_steps | ||
self.evaluation_steps = evaluation_steps | ||
|
@@ -359,7 +360,7 @@ def _validate_args( | |
|
||
if py_version == "py2" and self._only_python_3_supported(): | ||
msg = ( | ||
"Python 2 containers are only available until January 1st, 2020. " | ||
"Python 2 containers are only available before January 1st, 2020. " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's not strictly true. someone can always use an outdated image if they really want Python 2. why not use the same kind wording as the other places? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an error message that py2 container is not available at all. If customer is trying to use a py2 container when A revisit of this line makes me think we should just say py2 containers are not available with this framework version instead of saying they are available until Jan 1st. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, that sounds good. you could probably also add the latest version that is supported by Python 2 if you want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
"Please use a Python 3 container." | ||
) | ||
raise AttributeError(msg) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ | |
from sagemaker.fw_utils import ( | ||
framework_name_from_image, | ||
framework_version_from_tag, | ||
python_deprecation_warning, | ||
get_unsupported_framework_version_error, | ||
UploadedCode, | ||
) | ||
|
@@ -112,7 +111,7 @@ def __init__( | |
) | ||
|
||
if py_version == "py2": | ||
logger.warning(python_deprecation_warning(self.__framework_name__)) | ||
raise AttributeError("XGBoost container does not support Python 2, please use Python 3") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what would happen before when someone tried XGBoost + Python 2? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They will get errors when Python SDK tries to pull the xgboost py2 image because 1p algorithm team do not release xgboost py2 images. |
||
self.py_version = py_version | ||
|
||
if framework_version in XGBOOST_SUPPORTED_VERSIONS: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this point it might be worth starting to do
from sagemaker.pytorch import defaults
instead 😂