将MXNET模型转换为Apple CoreML模型格式的工具。
mxnet-coreml-converter的Python项目详细描述
这个工具帮助将mxnet模型转换成Apple CoreML格式,然后可以在苹果设备上运行。您可以在我们的github页面上找到有关该工具的更多信息。
先决条件
这个软件包只能安装在MacOSX上,因为它依赖于苹果的CoreMLSDK。此工具可以在MacOS 10.12或更高版本上运行,但需要在转换后的MacOS 10.13或更高版本(或用于手机、iOS 11或更高版本)上运行推断。
安装
安装此工具的方法遵循standard python package installation steps。设置好python环境后,请运行:
pip install mxnet-coreml-converter
包documentation包含有关如何使用coremltools的更多详细信息。
依赖关系
此工具具有以下依赖项: *pyyaml(3.12+) *MXnet(0.10.0+) *核心工具(0.5.1+)
示例用法
为了转换,例如aSqueezenet model,使用来自synset.txt的标签,执行以下操作
mxnet_coreml_converter.py --model-prefix='squeezenet_v1.1' \ --epoch=0 --input-shape='{"data":"3,227,227"}' \ --mode=classifier --pre-processing-arguments='{"image_input_names":"data"}' \ --class-labels synset.txt --output-file="squeezenetv11.mlmodel"