---
title: batchSize
framework: createml
role: symbol
role_heading: Instance Property
path: createml/mlobjectdetector/modelparameters-swift.struct/batchsize
---

# batchSize

The number of images the training session can use in a training iteration.

## Declaration

```swift
var batchSize: Int?
```

## Discussion

Discussion If you don’t have a preference, set this property to nil to tell Create ML to use an appropriate value when it trains the model.

## See Also

### Accessing the training parameters

- [validation](createml/mlobjectdetector/modelparameters-swift.struct/validation.md)
- [maxIterations](createml/mlobjectdetector/modelparameters-swift.struct/maxiterations.md)
- [algorithm](createml/mlobjectdetector/modelparameters-swift.struct/algorithm.md)
- [gridSize](createml/mlobjectdetector/modelparameters-swift.struct/gridsize.md)
