coremltools
coremltools copied to clipboard
Model initialized with `skip_model_load` does not have a compiled path
Code:
import coremltools as ct
m = ct.models.MLModel("<path to saved MLModel>", skip_model_load=True)
m.get_compiled_model_path()
Outputs:
----> 1 m.get_compiled_model_path()
File ~/miniforge3/envs/prod/lib/python3.8/site-packages/coremltools/models/model.py:528, in MLModel.get_compiled_model_path(self)
520 def get_compiled_model_path(self):
521 """
522 Returns the path for the underlying compiled ML Model.
523
(...)
526
527 """
--> 528 return self.__proxy__.get_compiled_model_path()
AttributeError: 'NoneType' object has no attribute 'get_compiled_model_path'
Correct behavior:
Return None without error.