coremltools
coremltools copied to clipboard
Kwargs propagation from _get_model in quantize_weights to MLModel in _get_model
When running quantize_weights
with the weights_dir
parameter, it doesn’t propagate to MLModel
, resulting in:
Exception: MLModel of type mlProgram cannot be loaded just from the model spec object. It also needs the path to the weights file. Please provide that as well, using the 'weights_dir' argument.
Adding **kwargs
in line 1691, in _get_model
of the quantization_utils
module, in the _get_model
signature and in the return MLModel(spec, compute_units=compute_units, **kwargs)
line fixes it.