Train Project - Train Project
Queues project for training.
POST {Endpoint}/customvision/v3.4-preview/training/projects/{projectId}/train
POST {Endpoint}/customvision/v3.4-preview/training/projects/{projectId}/train?trainingType={trainingType}&reservedBudgetInHours={reservedBudgetInHours}&forceTrain={forceTrain}¬ificationEmailAddress={notificationEmailAddress}
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
Endpoint
|
path | True |
string |
Supported Cognitive Services endpoints. |
project
|
path | True |
string uuid |
The project id. |
force
|
query |
boolean |
Whether to force train even if dataset and configuration does not change (default: false). |
|
notification
|
query |
string |
The email address to send notification to when training finishes (default: null). |
|
reserved
|
query |
integer int32 |
The number of hours reserved as budget for training (if applicable). |
|
training
|
query |
string |
The type of training to use to train the project (default: Regular). |
Request Header
Media Types: "application/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"
Name | Required | Type | Description |
---|---|---|---|
Training-Key | True |
string |
Request Body
Media Types: "application/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"
Name | Type | Description |
---|---|---|
customBaseModelInfo |
Information of the previously trained iteration which provides the base model for current iteration's training. |
|
selectedTags |
string[] |
List of tags selected for this training session, other tags in the project will be ignored. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK Media Types: "application/json", "application/xml", "text/xml" |
|
Other Status Codes |
Error response Media Types: "application/json", "application/xml", "text/xml" |
Security
Training-Key
Type:
apiKey
In:
header
Examples
Successful TrainProject request
Sample request
POST https://westus.api.cognitive.microsoft.com/customvision/v3.4-preview/training/projects/64b822c5-8082-4b36-a426-27225f4aa18c/train
{}
Sample response
{
"id": "e31a14ab-5d78-4f7b-a267-3a1e4fd8a758",
"name": "Iteration 2",
"status": "Training",
"created": "2017-12-18T22:40:36Z",
"lastModified": "2017-12-19T15:46:58Z",
"projectId": "64b822c5-8082-4b36-a426-27225f4aa18c",
"exportable": false,
"domainId": null,
"exportableTo": [
"ONNX",
"DockerFile",
"TensorFlow",
"CoreML"
],
"trainingType": "Regular",
"reservedBudgetInHours": 0,
"publishName": ""
}
Definitions
Name | Description |
---|---|
Classifier |
Gets the classification type of the project. |
Custom |
|
Custom |
|
Custom |
The error code. |
Exportable |
A set of platforms this iteration can export to. |
Iteration |
Iteration model to be sent over JSON. |
Training |
Parameters used for training. |
Training |
Gets the training type of the iteration. |
Classifier
Gets the classification type of the project.
Name | Type | Description |
---|---|---|
Multiclass |
string |
|
Multilabel |
string |
CustomBaseModelInfo
Name | Type | Description |
---|---|---|
iterationId |
string |
Iteration Id of the previously trained project to be used for current iteration's training. |
projectId |
string |
Project Id of the previously trained project to be used for current iteration's training. |
CustomVisionError
Name | Type | Description |
---|---|---|
code |
The error code. |
|
message |
string |
A message explaining the error reported by the service. |
CustomVisionErrorCodes
The error code.
Name | Type | Description |
---|---|---|
BadRequest |
string |
|
BadRequestCannotMigrateProjectWithName |
string |
|
BadRequestClassificationTrainingValidationFailed |
string |
|
BadRequestCustomBaseModelArchitectureRetired |
string |
|
BadRequestCustomBaseModelDomainNotCompatible |
string |
|
BadRequestCustomBaseModelIterationStatusNotCompleted |
string |
|
BadRequestCustomerManagedKeyRevoked |
string |
|
BadRequestDetectionTrainingNotAllowNegativeTag |
string |
|
BadRequestDetectionTrainingValidationFailed |
string |
|
BadRequestDomainNotSupportedForAdvancedTraining |
string |
|
BadRequestExceedIterationPerProjectLimit |
string |
|
BadRequestExceedProjectLimit |
string |
|
BadRequestExceedTagPerImageLimit |
string |
|
BadRequestExceedTagPerProjectLimit |
string |
|
BadRequestExceededBatchSize |
string |
|
BadRequestExceededQuota |
string |
|
BadRequestExportAlreadyInProgress |
string |
|
BadRequestExportPlatformNotSupportedForAdvancedTraining |
string |
|
BadRequestExportValidationFailed |
string |
|
BadRequestExportWhileTraining |
string |
|
BadRequestImageAspectRatio |
string |
|
BadRequestImageBatch |
string |
|
BadRequestImageDimensions |
string |
|
BadRequestImageExceededCount |
string |
|
BadRequestImageFormat |
string |
|
BadRequestImageMetadataKey |
string |
|
BadRequestImageMetadataValue |
string |
|
BadRequestImageRegions |
string |
|
BadRequestImageSizeBytes |
string |
|
BadRequestImageStream |
string |
|
BadRequestImageTags |
string |
|
BadRequestImageUrl |
string |
|
BadRequestInvalid |
string |
|
BadRequestInvalidArtifactUri |
string |
|
BadRequestInvalidEmailAddress |
string |
|
BadRequestInvalidIds |
string |
|
BadRequestInvalidImportToken |
string |
|
BadRequestInvalidPublishName |
string |
|
BadRequestInvalidPublishTarget |
string |
|
BadRequestInvalidUri |
string |
|
BadRequestIterationDescription |
string |
|
BadRequestIterationIsNotTrained |
string |
|
BadRequestIterationIsPublished |
string |
|
BadRequestIterationName |
string |
|
BadRequestIterationNameNotUnique |
string |
|
BadRequestIterationNotPublished |
string |
|
BadRequestIterationValidationFailed |
string |
|
BadRequestMultiClassClassificationTrainingValidationFailed |
string |
|
BadRequestMultiLabelClassificationTrainingValidationFailed |
string |
|
BadRequestMultipleGeneralProductTag |
string |
|
BadRequestMultipleNegativeTag |
string |
|
BadRequestNegativeAndRegularTagOnSameImage |
string |
|
BadRequestNotLimitedTrial |
string |
|
BadRequestNotSupported |
string |
|
BadRequestOperationNotSupported |
string |
|
BadRequestPredictionIdsExceededCount |
string |
|
BadRequestPredictionIdsMissing |
string |
|
BadRequestPredictionInvalidApplicationName |
string |
|
BadRequestPredictionInvalidQueryParameters |
string |
|
BadRequestPredictionResultsExceededCount |
string |
|
BadRequestPredictionTagsExceededCount |
string |
|
BadRequestProjectDescription |
string |
|
BadRequestProjectDuplicated |
string |
|
BadRequestProjectImagePreprocessingSettings |
string |
|
BadRequestProjectName |
string |
|
BadRequestProjectNameNotUnique |
string |
|
BadRequestProjectUnknownClassification |
string |
|
BadRequestProjectUnknownDomain |
string |
|
BadRequestProjectUnsupportedDomainTypeChange |
string |
|
BadRequestProjectUnsupportedExportPlatform |
string |
|
BadRequestRequiredParamIsNull |
string |
|
BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining |
string |
|
BadRequestRetiredDomainNotSupportedForTraining |
string |
|
BadRequestSubscriptionApi |
string |
|
BadRequestTagDescription |
string |
|
BadRequestTagName |
string |
|
BadRequestTagNameNotUnique |
string |
|
BadRequestTagType |
string |
|
BadRequestTrainingAlreadyInProgress |
string |
|
BadRequestTrainingNotNeeded |
string |
|
BadRequestTrainingNotNeededButTrainingPipelineUpdated |
string |
|
BadRequestTrainingValidationFailed |
string |
|
BadRequestUnpublishFailed |
string |
|
BadRequestUnsupportedDomain |
string |
|
BadRequestWorkspaceCannotBeModified |
string |
|
BadRequestWorkspaceNotDeletable |
string |
|
Conflict |
string |
|
ConflictInvalid |
string |
|
ErrorExporterInvalidClassifier |
string |
|
ErrorExporterInvalidFeaturizer |
string |
|
ErrorExporterInvalidPlatform |
string |
|
ErrorFeaturizationAugmentationError |
string |
|
ErrorFeaturizationAugmentationUnavailable |
string |
|
ErrorFeaturizationInvalidFeaturizer |
string |
|
ErrorFeaturizationQueueTimeout |
string |
|
ErrorFeaturizationServiceUnavailable |
string |
|
ErrorFeaturizationUnrecognizedJob |
string |
|
ErrorInvalid |
string |
|
ErrorIterationCopyFailed |
string |
|
ErrorPrediction |
string |
|
ErrorPredictionModelNotCached |
string |
|
ErrorPredictionModelNotFound |
string |
|
ErrorPredictionServiceUnavailable |
string |
|
ErrorPredictionStorage |
string |
|
ErrorPreparePerformanceMigrationFailed |
string |
|
ErrorProjectExportRequestFailed |
string |
|
ErrorProjectImportRequestFailed |
string |
|
ErrorProjectInvalidDomain |
string |
|
ErrorProjectInvalidPipelineConfiguration |
string |
|
ErrorProjectInvalidWorkspace |
string |
|
ErrorProjectTrainingRequestFailed |
string |
|
ErrorRegionProposal |
string |
|
ErrorServerTimeOut |
string |
|
ErrorUnknown |
string |
|
ErrorUnknownBaseModel |
string |
|
Forbidden |
string |
|
ForbiddenDRModeEnabled |
string |
|
ForbiddenInvalid |
string |
|
ForbiddenUser |
string |
|
ForbiddenUserDisabled |
string |
|
ForbiddenUserDoesNotExist |
string |
|
ForbiddenUserInsufficientCapability |
string |
|
ForbiddenUserResource |
string |
|
ForbiddenUserSignupAllowanceExceeded |
string |
|
ForbiddenUserSignupDisabled |
string |
|
NoError |
string |
|
NotFound |
string |
|
NotFoundApimSubscription |
string |
|
NotFoundDomain |
string |
|
NotFoundImage |
string |
|
NotFoundInvalid |
string |
|
NotFoundIteration |
string |
|
NotFoundIterationPerformance |
string |
|
NotFoundProject |
string |
|
NotFoundProjectDefaultIteration |
string |
|
NotFoundTag |
string |
|
UnsupportedMediaType |
string |
ExportableTo
A set of platforms this iteration can export to.
Name | Type | Description |
---|---|---|
CoreML |
string |
|
DockerFile |
string |
|
ONNX |
string |
|
OpenVino |
string |
|
TensorFlow |
string |
|
VAIDK |
string |
Iteration
Iteration model to be sent over JSON.
Name | Type | Description |
---|---|---|
classificationType |
Gets the classification type of the project. |
|
created |
string |
Gets the time this iteration was completed. |
customBaseModelInfo |
Information of the previously trained iteration which provides the base model for current iteration's training. Default value of null specifies that no previously trained iteration will be used for incremental learning. |
|
domainId |
string |
Get or sets a guid of the domain the iteration has been trained on. |
exportable |
boolean |
Whether the iteration can be exported to another format for download. |
exportableTo |
A set of platforms this iteration can export to. |
|
id |
string |
Gets the id of the iteration. |
lastModified |
string |
Gets the time this iteration was last modified. |
name |
string |
Gets or sets the name of the iteration. |
originalPublishResourceId |
string |
Resource Provider Id this iteration was originally published to. |
projectId |
string |
Gets the project id of the iteration. |
publishName |
string |
Name of the published model. |
reservedBudgetInHours |
integer |
Gets the reserved advanced training budget for the iteration. |
status |
string |
Gets the current iteration status. |
trainedAt |
string |
Gets the time this iteration was last modified. |
trainingErrorDetails |
string |
Training error details, when training fails. Value is null when training succeeds. |
trainingTimeInMinutes |
integer |
Gets the training time for the iteration. |
trainingType |
Gets the training type of the iteration. |
TrainingParameters
Parameters used for training.
Name | Type | Description |
---|---|---|
customBaseModelInfo |
Information of the previously trained iteration which provides the base model for current iteration's training. |
|
selectedTags |
string[] |
List of tags selected for this training session, other tags in the project will be ignored. |
TrainingType
Gets the training type of the iteration.
Name | Type | Description |
---|---|---|
Advanced |
string |
|
Regular |
string |