I'm converting Tensorflow models to CoreML .mlmodel using coremltools for a commercial macOS app. Results work, but checking the models with File/Open in Xcode report "Availability" of macOS 10.15+. That's no good for many existing customers, app must run on CoreML's minimum, macOS 10.13 (TBH 10.13 will throw many customers under the bus.) What controls the reported minimum macOS version? Is the reported number correct? What can be done to change it? Using different models or even retraining the existing models isn't practical for many reasons. Is there a coremltools option to convert to a mlmodel that runs on 10.13, even if the converted model has lower performance than one converted for 10.15? (I'd select the appropriate mlmodel to load dynamically.)
Change macOS "Availability" of CoreML models converted by CoreMLTools?
It depends on what features your model uses. If it has a layer type that is only supported by macOS 10.15+, then the model cannot be used on earlier versions of macOS.
However, if your model only has the most basic features from Core ML version 1, it can be used on macOS 10.13.
There is a field in the mlmodel file named specificationVersion. Set this to 1 to make the model available on 10.13. However, Core ML will give an error if it turns out this model has layer types that are not supported by 10.13.
However, if your model only has the most basic features from Core ML version 1, it can be used on macOS 10.13.
There is a field in the mlmodel file named specificationVersion. Set this to 1 to make the model available on 10.13. However, Core ML will give an error if it turns out this model has layer types that are not supported by 10.13.
Code Block import coremltools as ct spec = ct.utils.load_spec("YourModel.mlmodel") spec.specificationVersion = 1 ct.utils.save_spec(spec, "YourNewModel.mlmodel")