Re-train model, rebuild app?

Simple question: If I re-train/convert my .mlmodel, do I need to rebuild my app, or will the .mlmodel automatically be rebuilt?

(Kind of important, since it may not always be obvious during runtime whether the newly trained version is being used.)

Accepted Reply

This thread has been deleted

>Does building the app recompile the model, or should I clean first?


Ah.


- I don't think (re)building recompiles the model.

- A 'clean' supposedly wipes derived data for the selected target, but I think it's more like kissing your sister. I'd suggest in that example to only/always do an option-clean build folder. Hold the option key, use the 'Product' menu, then choose to 'clean build folder'. This blasts the entire dd folder, instead, and seems reliably effective where a clean seems to do little, if anything. Go figure. I don't think this wipes the model, either way.

But I think that if you apply compileModel appropriately, those tactics shouldn't be necessary.

Replies

Show your code where you use compileModel to recompile on device...



Compiling a Model

class func compileModel(at: URL)

Compile a model on device to install or update the model over the air.