Source and Conversion Formats#
convert() method of the Core ML Tools Unified Conversion API (available from Core ML Tools version 4.0 and newer versions) to convert deep learning models to the Core ML model format in order to deploy them in the Core ML framework.
Supported Source Formats#
Source model formats supported by the Unified Conversion API include the following:
TensorFlow versions 1.x Formats#
TensorFlow versions 2.x Formats#
TorchScript object saved as a
Target Conversion Formats#
You can choose which format to use during conversion using the
convert_to or the
minimum_deployment_target arguments in the
neuralnetwork was the format originally used by Core ML to represent neural networks, it is now in maintenance mode and no longer receiving new features. The
mlprogram model format, deployable to
tvOS15, and newer versions, is the recommended format.
neuralnetwork format is widely available, it is still the default format produced by versions of the Unified Conversion API older than 7.0. Calling convert() without providing the
convert_to or the
minimum_deployment_target parameters, in versions older than 7.0, defaults to the
macOS10.13 deployment target and the
However, in 7.0 and newer versions of Core ML Tools, the
convert() method produces an
mlprogram by default with the
macOS12 deployment target. You can override this behavior by providing a
The following table summarizes the format differences:
Minimum deployment target
macOS 10.13, iOS 11, watchOS 4, tvOS 11
macOS 12, iOS 15, watchOS 8, tvOS 15
Supported file formats
To learn more about the differences between the two formats, see Comparing ML Programs and Neural Networks.
Minimum Deployment Target#
Neural network: macOS 10.13, iOS 11, watchOS 4, tvOS 11
ML Program: macOS 12, iOS 15, watchOS 8, tvOS 15
Supported Core ML File Formats#
How to Produce#
Core ML Tools versions older than 7.0:
Neural network: Generated by default by the
ML Program: Use either
Core ML Tools 7.0 and newer:
Neural network: Use
ML Program: Generated by default by the
Neural network: Frozen, under maintenance only.
ML Program: All new features target the ML Program format.
Neural network: Limited.
ML Program: All major performance enhancements target ML Program.