Open mecid opened 5 years ago
It looks like TuriCreate is still exporting to Core ML using specificationVersion: 1
. You do indeed need version 4 in order to have an updatable model. There are also lots of other improvements made in Core ML since the first version.
We should update TuriCreate to export models to Core ML using the most recent specification version.
@TobyRoseman so there is no way to generate updatable Activity Classifier with Turi Create 5.7? As I remember it works before.
@mecid - There is no way to generate an updatable Core ML model with Turi Create 5.7. I also don't think this has worked with any previous version of Turi Create.
@TobyRoseman can we expect it anytime soon?
What if you add spec.specificationVersion = 4
to the above script?
@hollance it works! Model works correctly. I will try to run on-device update task. Is it legal to change version like this? I mean I can set version to 5 or whatever and it also works.
@mecid I'm not sure what version of coremltools you're using, but I think in the latest version, builder.set_categorical_cross_entropy_loss()
will automatically fill in that version number. If not, you can fill in anything you like here, but I would use 4 as that is the correct number. ;-)
@hollance so you mean by setting version to 4 and using builder.set_categorical_cross_entropy_loss() my Model packaging will be updated to latest version? I on the latest coreml tools beta version.
@mecid I was slightly mistaken, builder. make_updatable()
will now automatically fill in the specificationVersion
for you. Not sure why that didn't happen automatically in your script, as with the current beta version of coremltools it should do that. This means you shouldn't have to fill in specificationVersion
yourself anymore.
@hollance I'm on CoreML tools 3.0b3 and Turi Create 5.7. Is it safe to use that model with manual setting version to 4? I fear that it can be broken.
It is safe. Note that coremltools 3.0b4 is the latest, not b3.
@hollance thanks, just checked it now, we already have b5.
Ah nice!
Created #2860 to track the more general issue (i.e. this issue for all toolkits that support exporting to Core ML).
Hello, I try to do my Activity Classifier updatable using this script.
But I get the error:
RuntimeWarning: You will not be able to run predict() on this Core ML model. Underlying exception message was: Error compiling model: "Error reading protobuf spec. validator error: Model specification version for an updatable model must be '4' or above.".
I run MacOS 10.15 Beta 6 and Turi Create 5.7 with CoreML tools v3.0b3