Core ML is an Apple framework that allows developers to integrate machine learning/deep learning models into their applications. However, it does not support model creation and training, i.e., you first need to create the model in a framework like TensorFlow or PyTorch, then you can convert and use it. There are two ways you can convert your machine learning model from the framework of your choice to the Core ML model format: through an intermediary model format like ONNX or by using Apple’s own CoreMLTools Python library.

Although ONNX works just fine for the conversion, CoreMLTools offers other useful functionalities like model optimization. Also, you’ll need to use CoreMLTools for the final conversion from ONNX format to Core ML format anyway. Currently, it supports the conversion of models created using the following libraries:

  • PyTorch
  • TensorFlow 1.x & 2.x
  • TensorFlow’s Keras APIs
  • scikit-learn
  • XGBoost
  • LibSVM

#developers corner #apple ai #apple machine learning #core ml3 #coreml #coremltools #model conversion #python libraries

Converting PyTorch & TensorFlow Models Into Apple Core ML Using CoreMLTools
1.50 GEEK