diff --git a/onnxruntime/core/providers/coreml/model/model.mm b/onnxruntime/core/providers/coreml/model/model.mm index 1401cbe95fd56..5f4eebc7d72ce 100644 --- a/onnxruntime/core/providers/coreml/model/model.mm +++ b/onnxruntime/core/providers/coreml/model/model.mm @@ -394,7 +394,7 @@ Status Predict(const std::unordered_map& inputs, compiled_model_path_ = [compileUrl path]; - MLModelConfiguration* config = [MLModelConfiguration alloc]; + MLModelConfiguration* config = [[MLModelConfiguration alloc] init]; config.computeUnits = (coreml_flags_ & COREML_FLAG_USE_CPU_ONLY) ? MLComputeUnitsCPUOnly : MLComputeUnitsAll;