Skip to main content

Tool to convert MXNet models into Apple CoreML model format.

Project description

Apache MXNet (incubating) is a deep learning framework designed for both efficiency and flexibility. It allows you to mix symbolic and imperative programming to maximize efficiency and productivity. At its core, MXNet contains a dynamic dependency scheduler that automatically parallelizes both symbolic and imperative operations on the fly. A graph optimization layer on top of that makes symbolic execution fast and memory efficient. MXNet is portable and lightweight, scaling effectively to multiple GPUs and multiple machines.

Core ML is an Apple framework which allows developers to simply and easily integrate machine learning (ML) models into apps running on Apple devices (including iOS, watchOS, macOS, and tvOS). Core ML introduces a public file format (.mlmodel) for a broad set of ML methods including deep neural networks (both convolutional and recurrent), tree ensembles with boosting, and generalized linear models. Models in this format can be directly integrated into apps through Xcode.

This tool helps convert MXNet models into Apple CoreML format which can then be run on Apple devices. You can find more information about this tool on our github page.

Prerequisites

This package can only be installed on MacOS X since it relies on Apple’s CoreML SDK. It can be run on MacOS 10.11 or higher though for running inferences on the converted model MacOS 10.13 or higher is needed (or for phones, iOS 11 or above).

Installation

The method for installing this tool follows the standard python package installation steps. Once you have set up a python environment, run:

pip install mxnet-to-coreml

The package documentation contains more details on how to use coremltools.

Dependencies

This tool has the following dependencies:

  • mxnet (0.10.0+)

  • coremltools (0.5.1+)

  • pyyaml (3.12+)

Sample Usage

In order to convert, say a Squeezenet model, with labels from synset.txt, execute this

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"

More Information

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mxnet_to_coreml-0.1.1-cp27-cp27m-macosx_10_7_x86_64.whl (18.1 kB view details)

Uploaded CPython 2.7m macOS 10.7+ x86-64

File details

Details for the file mxnet_to_coreml-0.1.1-cp27-cp27m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for mxnet_to_coreml-0.1.1-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 df94bb6ec0aad4df7db82701b612a83d19bd9a6ea3dc7ad9ef5076ee85fe6b37
MD5 ed734fbd8fe25d3dc4f13af6625d2c0e
BLAKE2b-256 42ebd5b1849386265231c08453640ef63b1da14b6a81fc858f19ed37f5fbbd5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page