Core ML tools contain supporting tools for Core ML model conversion, editing, and validation.
BSD-3-CLAUSE License
Bot releases are visible (Hide)
Published by TobyRoseman over 3 years ago
coremltools.utils.rename_feature
utility for ML Program specPublished by TobyRoseman over 3 years ago
To install this version run: pip install coremltools==5.0b1
convert_to
argument with the unified converter API to indicate the model type of the Core ML model.
coremltools.convert(..., convert_to=“mlprogram”)
converts to a Core ML model of type ML program.coremltools.convert(..., convert_to=“neuralnetwork”)
converts to a Core ML model of type neural network. “Neural network” is the older Core ML format and continues to be supported. Using just coremltools.convert(...)
will default to produce a neural network Core ML model.ct.convert(..., convert_to=“mlprogram”, compute_precision=ct.precision.FLOAT32)
or ct.convert(..., convert_to=“mlprogram”, compute_precision=ct.precision.FLOAT16)
save
method. Simply use model.save("<model_name>.mlpackage")
instead of the usual model.save(<"model_name>.mlmodel")
convert_neural_network_weights_to_fp16()
, convert_neural_network_spec_weights_to_fp16()
, that had been deprecated in coremltools 4, have been removed.precision.FLOAT32
, although it will be updated to precision.FLOAT16
in a later beta release, prior to the official coremltools 5.0 release.useCPUOnly
argument during conversion. That is, ct.convert(source_model, convert_to='mlprogram', useCPUOnly=True)
. And for such models, in your swift code you can use the MLComputeUnits.cpuOnly option at the time of loading the model, to restrict the compute unit to CPU.Published by aseemw over 3 years ago
Published by aseemw about 4 years ago
coremltools
4.0ct.convert()
MIL
its easy to build neural network models directly or implement composite operations.ct.convert()
with ct.ImageType()
, ct.ClassifierConfig()
, etc., see details: https://coremltools.readme.io/docs/neural-network-conversion.coremltools
4coremltools
4Published by aseemw about 4 years ago
Several bug fixes, including:
rename_feature
API, when used with a neural network model with image inputs.pth
extension, in addition to .pt
extension , for torch conversioninverse
layer, on a few devices, by increasing the lower bound of the outputAdded conversion functions for PyTorch ops such as neg, sum, repeat, where, adaptive_max_pool2d, floordiv etc
Update Doc strings for several MIL ops
Support for TF1 models with fake quant ops when used with convolution ops
Several new MIL optimization passes such as no-op elimination, pad and conv fusion etc.
Published by bhushan23 about 4 years ago
Published by 1duo about 4 years ago
ct.convert()
for converting PyTorch and TensorFlow (including tf.keras
) models.ct.convert()
with ct.ImageType()
, ct.ClassifierConfig()
, etc., see details: https://coremltools.readme.io/docs/neural-network-conversion.ct.converters.onnx.convert()
.Deprecated the following methods
NeuralNetworkShaper
class.get_allowed_shape_ranges()
.can_allow_multiple_input_shapes()
.visualize_spec()
method of the MLModel
class.quantize_spec_weights()
, instead use the quantize_weights()
method.get_custom_layer_names()
, replace_custom_layer_name()
, has_custom_layer()
, moved them to internal methods.Added deprecation warnings for, will be deprecated in next major release.
convert_neural_network_weights_to_fp16()
, convert_neural_network_spec_weights_to_fp16()
. Instead use the quantize_weights()
method. See https://coremltools.readme.io/docs/quantization for details.coremltools.utils.rename_feature
does not work correctly in renaming the output feature of a model of type neural network classifierleaky_relu
layer is not added yet to the PyTorch converter, although it's supported in MIL and the Tensorflow converters.Published by 1duo over 4 years ago
ct.convert()
for converting PyTorch and TensorFlow (including tf.keras
) models.ct.convert()
with ct.ImageType()
, ct.ClassifierConfig()
, etc., see details: https://coremltools.readme.io/docs/neural-network-conversion.ct.converters.onnx.convert()
.Deprecated the following methods
NeuralNetworkShaper
class.get_allowed_shape_ranges()
.can_allow_multiple_input_shapes()
.visualize_spec()
method of the MLModel
class.quantize_spec_weights()
, instead use the quantize_weights()
method.get_custom_layer_names()
, replace_custom_layer_name()
, has_custom_layer()
, moved them to internal methods.Added deprecation warnings for, will be deprecated in next major release.
convert_neural_network_weights_to_fp16()
, convert_neural_network_spec_weights_to_fp16()
. Instead use the quantize_weights()
method. See https://coremltools.readme.io/docs/quantization for details.coremltools.utils.rename_feature
does not work correctly in renaming the output feature of a model of type neural network classifierleaky_relu
layer is not added yet to the PyTorch converter, although its supported in MIL and the Tensorflow converters.Published by aseemw over 4 years ago
tf.einsum
opembeddingND
layer, conversion of tf.stack
opNeuralNetworkShaper
and methods visualize_spec
, quantize_spec_weights
Published by srikris over 4 years ago
Published by 1duo almost 5 years ago
This release includes new op conversion supports, bug fixes, and improved graph optimization passes.
Install/upgrade to the latest coremltools
with pip install --upgrade coremltools
.
More details can be found in neural-network-guide.md.
Published by 1duo almost 5 years ago
AddV2
, FusedBatchNormV3
.tf.keras
model conversion supported only with TensorFlow 2tf.keras
graphs that contain recurrent layers.Published by aseemw about 5 years ago
We are very excited about the release of coremltools 3 and for Core ML release notes to become a fixture, increasing the issues resolved and features added. In this document, we give you an overview of the features and issues that were resolved in the most recent release. The issues can also be found on the project boards of each respective repository (for example, coremltools). The labels will also indicate the type of issue.
In addition to the features and improvements introduced in this release, there have been some changes within the repository. There are now issue templates to help specify the type of issue whether its a bug, feature request or question. and help us triage quickly. There is also a new document, contributing.md which contains guidelines for community engagement.
We are happy to announce the official release of coremltools 3 which aligns with Core ML 3. It includes a new version of the .mlmodel specification (version 4) which brings with it support for:
This version of coremltools also includes a new converter path for TensorFlow models. The tfcoreml converter has been updated to include this new path to convert to specification 4 which can handle control flow and cyclic tensor flow graphs.
Control flow example can be found here.
Core ML 3 supports an on-device update of models. Version 4 of the .mlmodel
specification can encapsulate all the necessary parameters for a model update. Nearest neighbor, neural networks and pipeline models can all be made updatable.
Updatable neural networks support the training of convolution and fully connected layer weights (with back-propagation through many other layers types). Categorical cross-entropy and mean squared error losses are available along with stochastic gradient descent and Adam optimizers.
See examples of how to convert and create updatable models.
See the MLUpdateTask API reference for how to update a model from within an app.
NeuralNetworkBuilder
Published by aseemw about 5 years ago
Published by Necross over 5 years ago
This is the first beta release of coremltools 3 which aligns with the preview of Core ML 3. It includes a new version of the .mlmodel specification which brings with it support for:
This release also enhances and introduces the following converters and utilities:
pip install tfcoreml==0.4.0b1
This release also adds Python 3.7 support for coremltools
Core ML 3 supports on-device update of models. Version 4 of the .mlmodel specification can encapsulate all the necessary parameters for a model update. Nearest neighbor, neural networks and pipeline models can all be made updatable.
Updatable neural networks support training of convolution and fully connected layer weights (with back-propagation through many other layers types). Categorical cross entropy and mean squared error losses are available along with stochastic gradient descent and Adam optimizers.
See examples of how to convert and create updatable models
See the MLUpdateTask API reference for how update a model from within an app.
coremltools 3.0b1
Core ML 3 Developer Beta 1
Published by aseemw over 5 years ago
Published by aseemw about 6 years ago
Published by znation over 6 years ago
Published by TobyRoseman almost 7 years ago
Published by srikris about 7 years ago
Note: coremltools-0.6.2 has a known issue with the useCPUOnly flag that failed on certain neural network models. This has been fixed with 0.6.3
Added support for layers in the NeuralNetworkBuilder that were present in the neural network protobuf but missing from the builder:
Added support for some of the missing parameters in NeuralNetworkBuilder: