-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Not detect requirements.txt in TensorFlow script mode #911
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
Comments
Thanks for bringing this up to our attention and for providing a quick minimal repro. I'm going to attempt to reproduce this and see why this is happening. I'll report back with my results. Thank you for your patience. |
Was able to repro the same error. Investigating now.
|
Okay, it looks like this is intended. Apologies on the mixed message in #839 There a few workarounds to enable requirements.txt
Please let me know if there is anything I can clarify. |
Hi @ChoiByungWook , I add setup.py in src/, and it worked. Then I created an example repository containing setup.py. |
@xkumiyu The sagemaker-keras-example that you put together worked for me as well. I confirmed the approach that you wrote which places setup.py and requirements.txt in the src directory; the combination of those two files will pull in the dependencies that are needed. |
Just wondering: Why is setup.py required for requirements.txt to be installed (said it was intentional)? |
Also, I am wondering how this fits to the documentation? Using setup.py is not mentioned, right? Also, when using PyTorch with SageMaker this is not necessary. |
Nothing is mentioned about the BTW, this is the misleading doc: https://sagemaker.readthedocs.io/en/stable/using_tf.html#use-third-party-libraries |
Yes, it it very confution about tf2.2,
|
I found another problem. Using the estimator = TensorFlow(
source_dir='src',
entry_point='utils/train.py',
model_dir=model_dir,
train_instance_type=train_instance_type,
train_instance_count=1,
hyperparameters=hyperparameters,
role=execution_role,
base_job_name='tf-2-workflow',
framework_version='2.1',
py_version='py3',
) the reason is that it sagemaker trys to execute the command: |
Can somebody explain why setup.py is required in this case? This isnt consistent with other parts of the sdk. And this seems to break quite often. There are many GitHub issues around the simple - and very common - need to specify a requirements.txt. Some clarity on this feature, it’s various workarounds, and stability would be greatly appreciated. @ChoiByungWook |
I was getting the same error but then it worked with the usual guide as in doc when I used py37 with tf2.2.
|
You, can also install external modules/libraries in the following way: import subprocess package='matplolib' install('matplotlib') |
System Information
Describe the problem
In #839, it was mentioned that Docker Image detected requirements.txt and installed python libraries, but in my experiment it was not installed.
I think the Image did not detect requirements.txt, but I confirmed that requirements.txt exists in sourcedir.tar.gz uploaded to S3.
Minimal repro / logs
The text was updated successfully, but these errors were encountered: