up:: [[Sagemaker MOC]] # Input and Output Channels for Sagemaker Training Jobs ## Inputs With SageMaker training jobs, you specify an "input channel" and configure it in the job definition. Each channel is a dictionary that specifies the data split. Each of these items will be made available on the instance in `/opt/ml/input/data/<stage>`. ### JSON Example ```json { "train" : { "ContentType": "trainingContentType", "TrainingInputMode": "File", "S3DistributionType": "FullyReplicated", "RecordWrapperType": "None" }, "evaluation" : { "ContentType": "evalContentType", "TrainingInputMode": "File", "S3DistributionType": "FullyReplicated", "RecordWrapperType": "None" }, "validation" : { "TrainingInputMode": "File", "S3DistributionType": "FullyReplicated", "RecordWrapperType": "None" } } ``` ### CDK Example ![[SAM-98-99#^d970ba]] - [Source](https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-training-algo-running-container.html) ## Outputs With SageMaker training jobs, model artifacts should be saved to `/opt/ml/model/` so that, with the training job output configuration, they will be zipped and added to S3. Failures can be written to the file `/opt/ml/output/failure` and the first 1024 characters will be returned as `FailureReason`. - [Source](https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-training-algo-output.html) - [[SAM-98-99#^5fb1a5|Original note]]