简体   繁体   中英

Re-importing mlmodel in CreateML

I'm testing the new awesome CreateML in an XCode playground. I used the MLImageClassifierBuilder() with the live view feature to create my model, and saved it. Now I would like to re-import my .mlmodel file into my playground to run some more tests, but I didn't found a way to do it.

This seemed obvious to me to find this capability when I closed my playground.

You can't continue training the same mlmodel. However, you can load the existing mlmodel and use it via the MLModel API, like so:

let compiledUrl = try MLModel.compileModel(at: modelUrl)
let model = try MLModel(contentsOf: compiledUrl)
model.prediction(....)

Never tried it myself, so I'm not 100% sure this works from a playground.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM