Open Kedharkb opened 1 year ago
What happens if you try to run the example in the same container but in command line?
python3 example.py
I want to rule out VSCode configuration issue.
I have the same issue, how did you resolve?
What happens if you try to run the example in the same container but in command line?
python3 example.py
I want to rule out VSCode configuration issue.
@eitansela I get the same error, Im not working on vscode. and Im trying to this code on mac.
I see it is not able to recognise the path - python3: can't open file '/opt/ml/processing/input/code/processing_script.py': [Errno 2] No such file or directory
can you please help me.
@VibhavariBellutagi19 can you run it not as part of VSCode, but with python scikit_learn_bring_your_own_container_local_processing.py
@eitansela i was able to run it outside of the dev container successfully just by invoking the local script
Hello, I am experiencing an issue while using SageMaker to build a machine learning model. in Sagemaker local mode, I am facing an issue that says "python3: can't open file '/opt/ml/processing/code/processing_script.py': [Errno 2] No such file or directory." Even though the file is present in the correct location, the same code works fine in the normal mode. I am running my project in vscode dev conatiner and inside the dev container i am trying out the sagemaker local mode. Please let me know what could possibly be wrong with the following code.
Error
Code
from sagemaker.local import LocalSession from sagemaker.processing import ProcessingInput, ProcessingOutput from sagemaker.sklearn.processing import SKLearnProcessor
sagemaker_session = LocalSession() sagemaker_session.config = {"local": {"local_code": True}}
role = "arn:aws:iam::111111111111:role/service-role/AmazonSageMaker-ExecutionRole-20200101T000001"
processor = SKLearnProcessor( framework_version="0.20.0", instance_count=1, instance_type="local", role=role )
print("Starting processing job.") print( "Note: if launching for the first time in local mode, container image download" " might take a few minutes to complete." ) processor.run( code="processing_script.py", inputs=[ ProcessingInput( source='./input_data/', destination="/opt/ml/processing/input_data/", ) ], outputs=[ ProcessingOutput( output_name="word_count_data", source="/opt/ml/processing/processed_data/" ) ], arguments=["job-type", "word-count"], )
preprocessing_job_description = processor.jobs[-1].describe() output_config = preprocessing_job_description["ProcessingOutputConfig"]
print(output_config)
for output in output_config["Outputs"]: if output["OutputName"] == "word_count_data": word_count_data_file = output["S3Output"]["S3Uri"]
print("Output file is located on: {}".format(word_count_data_file))