Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: CC-BY-SA-4.0

DescribeTrainingJob

Returns information about a training job.

{
   "[TrainingJobName](#SageMaker-DescribeTrainingJob-request-TrainingJobName)": "string"
}

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

** TrainingJobName ** The name of the training job.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 63.
Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*
Required: Yes

{
   "[AlgorithmSpecification](#SageMaker-DescribeTrainingJob-response-AlgorithmSpecification)": { 
      "[AlgorithmName](API_AlgorithmSpecification.md#SageMaker-Type-AlgorithmSpecification-AlgorithmName)": "string",
      "[MetricDefinitions](API_AlgorithmSpecification.md#SageMaker-Type-AlgorithmSpecification-MetricDefinitions)": [ 
         { 
            "[Name](API_MetricDefinition.md#SageMaker-Type-MetricDefinition-Name)": "string",
            "[Regex](API_MetricDefinition.md#SageMaker-Type-MetricDefinition-Regex)": "string"
         }
      ],
      "[TrainingImage](API_AlgorithmSpecification.md#SageMaker-Type-AlgorithmSpecification-TrainingImage)": "string",
      "[TrainingInputMode](API_AlgorithmSpecification.md#SageMaker-Type-AlgorithmSpecification-TrainingInputMode)": "string"
   },
   "[CreationTime](#SageMaker-DescribeTrainingJob-response-CreationTime)": number,
   "[EnableInterContainerTrafficEncryption](#SageMaker-DescribeTrainingJob-response-EnableInterContainerTrafficEncryption)": boolean,
   "[EnableNetworkIsolation](#SageMaker-DescribeTrainingJob-response-EnableNetworkIsolation)": boolean,
   "[FailureReason](#SageMaker-DescribeTrainingJob-response-FailureReason)": "string",
   "[FinalMetricDataList](#SageMaker-DescribeTrainingJob-response-FinalMetricDataList)": [ 
      { 
         "[MetricName](API_MetricData.md#SageMaker-Type-MetricData-MetricName)": "string",
         "[Timestamp](API_MetricData.md#SageMaker-Type-MetricData-Timestamp)": number,
         "[Value](API_MetricData.md#SageMaker-Type-MetricData-Value)": number
      }
   ],
   "[HyperParameters](#SageMaker-DescribeTrainingJob-response-HyperParameters)": { 
      "string" : "string" 
   },
   "[InputDataConfig](#SageMaker-DescribeTrainingJob-response-InputDataConfig)": [ 
      { 
         "[ChannelName](API_Channel.md#SageMaker-Type-Channel-ChannelName)": "string",
         "[CompressionType](API_Channel.md#SageMaker-Type-Channel-CompressionType)": "string",
         "[ContentType](API_Channel.md#SageMaker-Type-Channel-ContentType)": "string",
         "[DataSource](API_Channel.md#SageMaker-Type-Channel-DataSource)": { 
            "[S3DataSource](API_DataSource.md#SageMaker-Type-DataSource-S3DataSource)": { 
               "[AttributeNames](API_S3DataSource.md#SageMaker-Type-S3DataSource-AttributeNames)": [ "string" ],
               "[S3DataDistributionType](API_S3DataSource.md#SageMaker-Type-S3DataSource-S3DataDistributionType)": "string",
               "[S3DataType](API_S3DataSource.md#SageMaker-Type-S3DataSource-S3DataType)": "string",
               "[S3Uri](API_S3DataSource.md#SageMaker-Type-S3DataSource-S3Uri)": "string"
            }
         },
         "[InputMode](API_Channel.md#SageMaker-Type-Channel-InputMode)": "string",
         "[RecordWrapperType](API_Channel.md#SageMaker-Type-Channel-RecordWrapperType)": "string",
         "[ShuffleConfig](API_Channel.md#SageMaker-Type-Channel-ShuffleConfig)": { 
            "[Seed](API_ShuffleConfig.md#SageMaker-Type-ShuffleConfig-Seed)": number
         }
      }
   ],
   "[LabelingJobArn](#SageMaker-DescribeTrainingJob-response-LabelingJobArn)": "string",
   "[LastModifiedTime](#SageMaker-DescribeTrainingJob-response-LastModifiedTime)": number,
   "[ModelArtifacts](#SageMaker-DescribeTrainingJob-response-ModelArtifacts)": { 
      "[S3ModelArtifacts](API_ModelArtifacts.md#SageMaker-Type-ModelArtifacts-S3ModelArtifacts)": "string"
   },
   "[OutputDataConfig](#SageMaker-DescribeTrainingJob-response-OutputDataConfig)": { 
      "[KmsKeyId](API_OutputDataConfig.md#SageMaker-Type-OutputDataConfig-KmsKeyId)": "string",
      "[S3OutputPath](API_OutputDataConfig.md#SageMaker-Type-OutputDataConfig-S3OutputPath)": "string"
   },
   "[ResourceConfig](#SageMaker-DescribeTrainingJob-response-ResourceConfig)": { 
      "[InstanceCount](API_ResourceConfig.md#SageMaker-Type-ResourceConfig-InstanceCount)": number,
      "[InstanceType](API_ResourceConfig.md#SageMaker-Type-ResourceConfig-InstanceType)": "string",
      "[VolumeKmsKeyId](API_ResourceConfig.md#SageMaker-Type-ResourceConfig-VolumeKmsKeyId)": "string",
      "[VolumeSizeInGB](API_ResourceConfig.md#SageMaker-Type-ResourceConfig-VolumeSizeInGB)": number
   },
   "[RoleArn](#SageMaker-DescribeTrainingJob-response-RoleArn)": "string",
   "[SecondaryStatus](#SageMaker-DescribeTrainingJob-response-SecondaryStatus)": "string",
   "[SecondaryStatusTransitions](#SageMaker-DescribeTrainingJob-response-SecondaryStatusTransitions)": [ 
      { 
         "[EndTime](API_SecondaryStatusTransition.md#SageMaker-Type-SecondaryStatusTransition-EndTime)": number,
         "[StartTime](API_SecondaryStatusTransition.md#SageMaker-Type-SecondaryStatusTransition-StartTime)": number,
         "[Status](API_SecondaryStatusTransition.md#SageMaker-Type-SecondaryStatusTransition-Status)": "string",
         "[StatusMessage](API_SecondaryStatusTransition.md#SageMaker-Type-SecondaryStatusTransition-StatusMessage)": "string"
      }
   ],
   "[StoppingCondition](#SageMaker-DescribeTrainingJob-response-StoppingCondition)": { 
      "[MaxRuntimeInSeconds](API_StoppingCondition.md#SageMaker-Type-StoppingCondition-MaxRuntimeInSeconds)": number
   },
   "[TrainingEndTime](#SageMaker-DescribeTrainingJob-response-TrainingEndTime)": number,
   "[TrainingJobArn](#SageMaker-DescribeTrainingJob-response-TrainingJobArn)": "string",
   "[TrainingJobName](#SageMaker-DescribeTrainingJob-response-TrainingJobName)": "string",
   "[TrainingJobStatus](#SageMaker-DescribeTrainingJob-response-TrainingJobStatus)": "string",
   "[TrainingStartTime](#SageMaker-DescribeTrainingJob-response-TrainingStartTime)": number,
   "[TuningJobArn](#SageMaker-DescribeTrainingJob-response-TuningJobArn)": "string",
   "[VpcConfig](#SageMaker-DescribeTrainingJob-response-VpcConfig)": { 
      "[SecurityGroupIds](API_VpcConfig.md#SageMaker-Type-VpcConfig-SecurityGroupIds)": [ "string" ],
      "[Subnets](API_VpcConfig.md#SageMaker-Type-VpcConfig-Subnets)": [ "string" ]
   }
}

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

** AlgorithmSpecification ** Information about the algorithm used for training, and algorithm metadata.
Type: AlgorithmSpecification object

** CreationTime ** A timestamp that indicates when the training job was created.
Type: Timestamp

** EnableInterContainerTrafficEncryption ** To encrypt all communications between ML compute instances in distributed training, choose True. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithms in distributed training.
Type: Boolean

** EnableNetworkIsolation ** If you want to allow inbound or outbound network calls, except for calls between peers within a training cluster for distributed training, choose True. If you enable network isolation for training jobs that are configured to use a VPC, Amazon SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.
The Semantic Segmentation built-in algorithm does not support network isolation. Type: Boolean

** FailureReason ** If the training job failed, the reason it failed.
Type: String
Length Constraints: Maximum length of 1024.

** FinalMetricDataList ** A collection of MetricData objects that specify the names, values, and dates and times that the training algorithm emitted to Amazon CloudWatch.
Type: Array of MetricData objects
Array Members: Minimum number of 0 items. Maximum number of 20 items.

** HyperParameters ** Algorithm-specific parameters.
Type: String to string map
Key Length Constraints: Maximum length of 256.
Key Pattern: .*
Value Length Constraints: Maximum length of 256.
Value Pattern: .*

** InputDataConfig ** An array of Channel objects that describes each data input channel.
Type: Array of Channel objects
Array Members: Minimum number of 1 item. Maximum number of 20 items.

** LabelingJobArn ** The Amazon Resource Name (ARN) of the Amazon SageMaker Ground Truth labeling job that created the transform or training job.
Type: String
Length Constraints: Maximum length of 2048.
Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:labeling-job/.*

** LastModifiedTime ** A timestamp that indicates when the status of the training job was last modified.
Type: Timestamp

** ModelArtifacts ** Information about the Amazon S3 location that is configured for storing model artifacts.
Type: ModelArtifacts object

** OutputDataConfig ** The S3 path where model artifacts that you configured when creating the job are stored. Amazon SageMaker creates subfolders for model artifacts.
Type: OutputDataConfig object

** ResourceConfig ** Resources, including ML compute instances and ML storage volumes, that are configured for model training.
Type: ResourceConfig object

** RoleArn ** The AWS Identity and Access Management (IAM) role configured for the training job.
Type: String
Length Constraints: Minimum length of 20. Maximum length of 2048.
Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$

** SecondaryStatus ** Provides detailed information about the state of the training job. For detailed information on the secondary status of the training job, see StatusMessage under SecondaryStatusTransition.
Amazon SageMaker provides primary statuses and secondary statuses that apply to each of them:
InProgress
+ Starting - Starting the training job. + Downloading - An optional stage for algorithms that support File training input mode. It indicates that data is being downloaded to the ML storage volumes. + Training - Training is in progress. + Uploading - Training is complete and the model artifacts are being uploaded to the S3 location.
Completed
+ Completed - The training job has completed.
Failed
+ Failed - The training job has failed. The reason for the failure is returned in the FailureReason field of DescribeTrainingJobResponse.
Stopped
+ MaxRuntimeExceeded - The job stopped because it exceeded the maximum allowed runtime. + Stopped - The training job has stopped.
Stopping
+ Stopping - Stopping the training job. Valid values for SecondaryStatus are subject to change. We no longer support the following secondary statuses:
+ LaunchingMLInstances + PreparingTrainingStack + DownloadingTrainingImage Type: String
Valid Values:Starting | LaunchingMLInstances | PreparingTrainingStack | Downloading | DownloadingTrainingImage | Training | Uploading | Stopping | Stopped | MaxRuntimeExceeded | Completed | Failed | Interrupted | MaxWaitTimeExceeded

** SecondaryStatusTransitions ** A history of all of the secondary statuses that the training job has transitioned through.
Type: Array of SecondaryStatusTransition objects

** StoppingCondition ** Specifies a limit to how long a model training job can run. When the job reaches the time limit, Amazon SageMaker ends the training job. Use this API to cap model training costs.
To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.
Type: StoppingCondition object

** TrainingEndTime ** Indicates the time when the training job ends on training instances. You are billed for the time interval between the value of TrainingStartTime and this time. For successful jobs and stopped jobs, this is the time after model artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker detects a job failure.
Type: Timestamp

** TrainingJobArn ** The Amazon Resource Name (ARN) of the training job.
Type: String
Length Constraints: Maximum length of 256.
Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:training-job/.*

** TrainingJobName ** Name of the model training job.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 63.
Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*

** TrainingJobStatus ** The status of the training job.
Amazon SageMaker provides the following training job statuses:
+ InProgress - The training is in progress. + Completed - The training job has completed. + Failed - The training job has failed. To see the reason for the failure, see the FailureReason field in the response to a DescribeTrainingJobResponse call. + Stopping - The training job is stopping. + Stopped - The training job has stopped. For more detailed information, see SecondaryStatus.
Type: String
Valid Values:InProgress | Completed | Failed | Stopping | Stopped

** TrainingStartTime ** Indicates the time when the training job starts on training instances. You are billed for the time interval between this time and the value of TrainingEndTime. The start time in CloudWatch Logs might be later than this time. The difference is due to the time it takes to download the training data and to the size of the training container.
Type: Timestamp

** TuningJobArn ** The Amazon Resource Name (ARN) of the associated hyperparameter tuning job if the training job was launched by a hyperparameter tuning job.
Type: String
Length Constraints: Maximum length of 256.
Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:hyper-parameter-tuning-job/.*

** VpcConfig ** A VpcConfig object that specifies the VPC that this training job has access to. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.
Type: VpcConfig object

For information about the errors that are common to all actions, see Common Errors.

ResourceNotFound
Resource being access is not found.
HTTP Status Code: 400

For more information about using this API in one of the language-specific AWS SDKs, see the following: + AWS Command Line Interface + AWS SDK for .NET + AWS SDK for C++ + AWS SDK for Go + AWS SDK for Go - Pilot + AWS SDK for Java + AWS SDK for JavaScript + AWS SDK for PHP V3 + AWS SDK for Python + AWS SDK for Ruby V2