Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile mlmodel on a linux server

Tags:

ios

coreml

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 ?

like image 780
Cerise Avatar asked Oct 19 '25 18:10

Cerise


1 Answers

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/

like image 98
Matthijs Hollemans Avatar answered Oct 22 '25 10:10

Matthijs Hollemans



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!