Search code examples
iosswiftgpucpucoreml

Loading coreml model in the background with cpu


I know we can turn "usesCPUOnly" flag on for prediction or detection, but how can we make sure the model is being loaded in the background on cpu (as gpu is unavailable)?


Solution

  • As of iOS 12, when you create the model you can pass in an option for this, see MLModelConfiguration.