I'm getting the above error when trying to run:
model.export_coreml('MyCustomObjectDetector.mlmodel')
model.export_coreml('MyCustomObjectDetector.mlmodel')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/amir/anaconda/envs/CVision/lib/python2.7/site-packages/turicreate/toolkits/object_detector/object_detector.py", line 1477, in export_coreml
mlmodel = coremltools.models.MLModel(model)
File "/Users/amir/anaconda/envs/CVision/lib/python2.7/site-packages/coremltools/models/model.py", line 209, in __init__
self.__proxy__ = _get_proxy_from_spec(filename)
File "/Users/amir/anaconda/envs/CVision/lib/python2.7/site-packages/coremltools/models/model.py", line 103, in _get_proxy_from_spec
return _MLModelProxy(filename)
I'm on coremltools 2.0b1
pip 9.0.1
turicreate 5.0b1
python 2.7.13
Xcode 10.0 beta
macOS High Sierra 10.13.4
Not sure what to do, I wish the error would be more descriptive about what one should do in order to resolve this.
@amiraeitan This message means that Turi Create tried to save a model, while running on macOS 10.13, that isn't actually compatible with macOS 10.13. This seems like a bug, assuming we should be able to export object detector models that run on 10.13.
@gustavla Is it expected that a 5.0b1 object detector model, when exported to Core ML, requires Xcode 10+ (macOS 10.14+)? That's the behavior we're seeing here. We should make sure the spec version is the minimum needed to execute the model (in this case probably 1 or 2?).
@amiraeitan In the meantime, you can work around this bug by setting include_non_maximum_suppression to False. See https://apple.github.io/turicreate/docs/api/generated/turicreate.object_detector.ObjectDetector.export_coreml.html#turicreate.object_detector.ObjectDetector.export_coreml
@znation I'm a bit uncertain about this now. Linux doesn't have a runtime support for the Core ML model, but it can still export the file itself. Shouldn't this also be true for macOS 10.13 then?
@gustavla I think the behavior we're seeing is due to the logic in coremltools, which seems intended but may not be the logic we want going forward:
predict function will be available).predict function.For this, I opened https://github.com/apple/coremltools/issues/198 to track in coremltools; when that's resolved, we can fix this issue by taking a dependency on the coremltools version that has the fix.
Thanks guys! I've downgraded to the 4.0 version for now and the export was working fine.
This should be fixed by #778 and apple/coremltools#207
I'm getting a similar issue: https://stackoverflow.com/questions/64814282/error-reading-protobuf-spec-validator-error