Posts

Post not yet marked as solved
7 Replies
The old way of determining if dictation was taking place: UITextInputMode.primaryLanguage == @"dictation" if no longer working for iOS 16.4 is this a bug and will it be restored in the future, or will another way to determine if dictation is about to take place be provided? Thanks, Rob
Post not yet marked as solved
3 Replies
Thanks very much for your help. I am really looking forward to more updates to your On device training with Core ML series.
Post not yet marked as solved
16 Replies
Looks like XCode 11 beta 5 does now include a Classifier in Create ML although the model created is not updatable.Possibly someone could comment on if the Classifier Models which are created by Create ML will be updatable possible in a later beta?
Post not yet marked as solved
16 Replies
Thanks, not ony does this show me how to create a classifier but also with the ability to make the model updatable.
Post not yet marked as solved
16 Replies
Thanks for adding in the code for scikit. Does anyone have a link to code which will produce a classifier updatable model using csv files? Should be very easy to modify that to get the column prediction I need.Regards,Rob
Post not yet marked as solved
16 Replies
Thanks for the help. After looking through the Core ML headers, I found the following list of updatable model types: /// Following model types support on-device update: /// /// - NeuralNetworkClassifier /// - NeuralNetworkRegressor /// - NeuralNetwork /// - KNearestNeighborsClassifierSince the MLClassifier did not create any of these, I need to use a different method to create the model.I believe it would be best if I could keep using the playground I have which pulls data from a remote SQL DB and creates the model. So, is there anything similiar to the MLClassifier which I can use in Swift to create such a model?Thanks for all the help and the 2 books. I'll keep reading but there is a lot to digest. Any short cut or pointers would be appreciated.
Post not yet marked as solved
16 Replies
I fixed the problem arrising from "validator error: Last model in an updatable pipeline model should be marked as updatable."And now XCode gives me a new error:validator error: This model type is not supported for on-device update.Sound like this error is unsurmountable. Is there a list of supported types for on-device update? Possibly I could rework the model to be one of these types, or is it possible that as of a later XCode beta this type will be supported for on-device update?Thanks again.Here's the code which got me thus far: if let url = Bundle.main.url(forResource: "predictor", withExtension: "bin"), let data = try? Data(contentsOf: url), var model = try? CoreML_Specification_Model(serializedData: data) { /* do other stuff with model */ model.isUpdatable = true for i in 0..<model.pipelineClassifier.pipeline.models.count { model.pipelineClassifier.pipeline.models[i].isUpdatable = true } if let data = try? model.serializedData() { let writableUrl = URL.init(fileURLWithPath: "/Users/Me/Documents/predictor.mlmodel") try? data.write(to: writableUrl) } }
Post not yet marked as solved
16 Replies
Thanks the updatable model examples look to be compiled python (I'm more iOS ObjC/Swift proficient) and I can not seem to see what is going on inside.I did go and try to make a model updatable as such: if let url = Bundle.main.url(forResource: "Predictor", withExtension: "bin"), let data = try? Data(contentsOf: url), var model = try? CoreML_Specification_Model(serializedData: data) { /* do other stuff with model */ print(model.description_p) print(model.pipelineClassifier) model.isUpdatable = true print(model.description_p) print(model.pipelineClassifier) if let data = try? model.serializedData() { try? data.write(to: url) } }When I rename and pull in that model, I get the following error:validator error: Last model in an updatable pipeline model should be marked as updatable.I will go and dig into this error, but maybe there is a tutorial as to how to make a model updatable? Any links or sugestions would help.Thanks,Rob
Post not yet marked as solved
16 Replies
Thanks, I will look into the "Using Protobuf Without coremltools" section and the coremltools examples and do not mind any low level programming.Would you recommend a different approach if I already have a playground to create the models? Maybe there is a simple python script to modify existung models to be updatable?I would think many people would be looking to make their models updatable with iOS 13 coming and doing so should become regular practice.Thanks again for all the help and the quick answers.
Post not yet marked as solved
16 Replies
Thanks very much for your quick reply. I hope I do not come off as sounding like an ad for your book, but I did purchase the book.Could you point me to where in the book I should look to use swift to convert? I have a swift playground which currently pulls from an external SQL DB to build the model and would like to be able to update that playground to build the updatable model.Thanks again for all the help and I wish you well with the book.