简体   繁体   中英

Compile mlmodel on a linux server

I'm wondering if there is a solution out there to compile a .mlmodel to a .mlmodelc on a linux server ?

I know this can be done with

xcrun coremlcompiler compile /path/to/MyModel.mlmodel /path/to/

But xcrun isn't available for linux. What would be the best solution ? Am I forced to build it in-app ?

let compiledModelUrl = try? MLModel.compileModel(at: destinationFileUrl)

Should I use an OSX server just for this ?

Why do you want to do this? So you can run the Core ML model from Swift on Linux, or for some other reason?

If you want to run Core ML models from Swift on Linux, you're out of luck, as Core ML is a macOS/iOS-only framework.

However, you may want to check out NNVM, a compiler that can convert Core ML model files into code that runs on CUDA, OpenCL, etc.

https://aws.amazon.com/blogs/ai/introducing-nnvm-compiler-a-new-open-end-to-end-compiler-for-ai-frameworks/

I've been researching this for some time now and am not sure it's possible. Did you manage to do it?

I think a possible solution would be sending images to the server and getting the result from there rather than creating an .mlmodel on the device or getting one from the server, both of which I couldn't do. What did you end up doing? I'm new to stackoverflow and most features aren't unlocked. If you have Telegram, could you contact me @skinminers ?

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