Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Run Your Processing Container Using the SageMaker AI Python SDK

Focus mode
Run Your Processing Container Using the SageMaker AI Python SDK - Amazon SageMaker AI

You can use the SageMaker Python SDK to run your own processing image by using the Processor class. The following example shows how to run your own processing container with one input from Amazon Simple Storage Service (Amazon S3) and one output to Amazon S3.

from sagemaker.processing import Processor, ProcessingInput, ProcessingOutput processor = Processor(image_uri='<your_ecr_image_uri>', role=role, instance_count=1, instance_type="ml.m5.xlarge") processor.run(inputs=[ProcessingInput( source='<s3_uri or local path>', destination='/opt/ml/processing/input_data')], outputs=[ProcessingOutput( source='/opt/ml/processing/processed_data', destination='<s3_uri>')], )

Instead of building your processing code into your processing image, you can provide a ScriptProcessor with your image and the command that you want to run, along with the code that you want to run inside that container. For an example, see Run Scripts with Your Own Processing Container.

You can also use the scikit-learn image that Amazon SageMaker Processing provides through SKLearnProcessor to run scikit-learn scripts. For an example, see Run a Processing Job with scikit-learn.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.