---
title: "makeTrainingSession(trainingData:annotationType:parameters:sessionParameters:)"
framework: createml
role: symbol
role_heading: Type Method
path: "createml/mlobjectdetector/maketrainingsession(trainingdata:annotationtype:parameters:sessionparameters:)"
---

# makeTrainingSession(trainingData:annotationType:parameters:sessionParameters:)

Creates an asynchronous object-detector training session.

## Declaration

```swift
static func makeTrainingSession(trainingData: MLObjectDetector.DataSource, annotationType: MLObjectDetector.AnnotationType, parameters: MLObjectDetector.ModelParameters = ModelParameters(), sessionParameters: MLTrainingSessionParameters = __Defaults.sessionParameters) throws -> MLTrainingSession<MLObjectDetector>
```

## Parameters

- `trainingData`: The annotated images the task uses to train the object detector.
- `annotationType`: The format type of the image annotations in the data source.
- `parameters`: An doc://com.apple.createml/documentation/CreateML/MLObjectDetector/ModelParameters-swift.struct instance you use to set the model configuration settings for the training session.
- `sessionParameters`: An doc://com.apple.createml/documentation/CreateML/MLTrainingSessionParameters instance you use to configure the training session.

## Return Value

Return Value An MLTrainingSession that represents the object-detector training session.

## Discussion

Discussion Use resume(_:) to start the MLTrainingSession instance you get from this method.

## See Also

### Training an object detector asynchronously

- [train(trainingData:annotationType:parameters:sessionParameters:)](createml/mlobjectdetector/train(trainingdata:annotationtype:parameters:sessionparameters:).md)
- [resume(_:)](createml/mlobjectdetector/resume(_:).md)
- [restoreTrainingSession(sessionParameters:)](createml/mlobjectdetector/restoretrainingsession(sessionparameters:).md)
