Cerise
Cerise

Reputation: 403

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 ?

Upvotes: 4

Views: 2667

Answers (1)

Matthijs Hollemans
Matthijs Hollemans

Reputation: 7892

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/

Upvotes: 4

Related Questions