Skip to content
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

Python 3.6 unsupported [bug/question] #161

Open
adamwrobel-ext-gd opened this issue Nov 15, 2022 · 1 comment
Open

Python 3.6 unsupported [bug/question] #161

adamwrobel-ext-gd opened this issue Nov 15, 2022 · 1 comment

Comments

@adamwrobel-ext-gd
Copy link

There are a few usages of capture_output in subprocess in this repo, they are not runnable in Python 3.6. Is this Python version supported?

My usage:

estimator = Estimator(image_uri=f"{account}.dkr.ecr.{region}.amazonaws.com/{repo}:{latest_image}",
                      role=role,
                      instance_count=1,
                      instance_type=instance_type,
                      output_path=output_path)

Image I built myself and put into ECR:

FROM amd64/python:3.6

RUN pip3 glove-python

COPY train.py /opt/ml/code/train.py

ENV SAGEMAKER_PROGRAM train.py

Error:

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                                                                                                                                                                                                                                              message                                                                                                                                                                                                                                                                                              |
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1668507472157 | /usr/local/lib/python3.6/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.   from cryptography.hazmat.backends import default_backend                                                                                                                                                                                                                                                                           
| 1668507472157 | Reporting training FAILURE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
| 1668507472157 | Framework Error:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 1668507472157 | Traceback (most recent call last):   
File "/usr/local/lib/python3.6/site-packages/sagemaker_training/trainer.py", line 69, in train     env = environment.Environment()   File "/usr/local/lib/python3.6/site-packages/sagemaker_training/environment.py", line 672, in __init__     self._is_smddpmprun_installed = validate_smddpmprun()   
File "/usr/local/lib/python3.6/site-packages/sagemaker_training/environment.py", line 373, in validate_smddpmprun     check=True,   
File "/usr/local/lib/python3.6/subprocess.py", line 423, in run     with Popen(*popenargs, **kwargs) as process: |
| 1668507472157 | TypeError: __init__() got an unexpected keyword argument 'capture_output'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 1668507472157 | __init__() got an unexpected keyword argument 'capture_output'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 1668507472158 | Encountered exit_code 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
@adamwrobel-ext-gd
Copy link
Author

This can be worked around by using older version
sagemaker-training==4.3.0

This means the Python 3.6 backwards incompatibility was introduced quite recently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant