Deep learning model converter, visualization and editor.
MMdnn is a comprehensive and cross-framework tool to convert, visualize and diagnose deep learning (DL) models. The "MM" stands for model management, and "dnn" is the acronym of deep neural network.
Major features include:
- We implement a universal converter to convert DL models between frameworks, which means you can train a model with one framework and deploy it with another.
- During the model conversion, we generate some code snippets to simplify later retraining or inference.
Model Search & Visualization
- We provide a model collection to help you find some popular models.
- We provide a model visualizer to display the network architecture more intuitively.
- OpenPAI : an open source platform that provides complete AI model training and resource management capabilities, it is easy to extend and supports on-premise, cloud and hybrid environments in various scale.
- FrameworkController : an open source general-purpose Kubernetes Pod Controller that orchestrate all kinds of applications on Kubernetes by a single controller.
- NNI : a lightweight but powerful toolkit to help users automate Feature Engineering, Neural Architecture Search, Hyperparameter Tuning and Model Compression.
- NeuronBlocks : an NLP deep learning modeling toolkit that helps engineers to build DNN models like playing Lego. The main goal of this toolkit is to minimize developing cost for NLP deep neural network model building, including both training and inference stages.
- SPTAG : Space Partition Tree And Graph (SPTAG) is an open source library for large scale vector approximate nearest neighbor search scenario.
We encourage researchers, developers and students to leverage these projects to boost their AI / Deep Learning productivity.
You can get a stable version of MMdnn by
pip install mmdnn
And make sure to have Python installed or you can try the newest version by
pip install -U git+https://github.com/Microsoft/MMdnn.git@master
Install with docker image
MMdnn provides a docker image, which packages MMdnn and Deep Learning frameworks that we support as well as other dependencies. You can easily try the image with the following steps:
Install Docker Community Edition(CE)
Pull MMdnn docker image
docker pull mmdnn/mmdnn:cpu.small
Run image in an interactive mode
docker run -it mmdnn/mmdnn:cpu.small
Across the industry and academia, there are a number of existing frameworks available for developers and researchers to design a model, where each framework has its own network structure definition and saving model format. The gaps between frameworks impede the inter-operation of the models.
We provide a model converter to help developers convert models between frameworks through an intermediate representation format.
[Note] You can click the links to get detailed README of each framework.
- Microsoft Cognitive Toolkit (CNTK)
- ONNX (Destination only)
- TensorFlow (Experimental) (We highly recommend you read the README of TensorFlow first)
- DarkNet (Source only, Experiment)
The model conversion between currently supported frameworks is tested on some ImageNet models.
One command to achieve the conversion. Using TensorFlow ResNet V2 152 to PyTorch as our example.
$ mmdownload -f tensorflow -n resnet_v2_152 -o ./ $ mmconvert -sf tensorflow -in imagenet_resnet_v2_152.ckpt.meta -iw imagenet_resnet_v2_152.ckpt --dstNodeName MMdnn_Output -df pytorch -om tf_resnet_to_pth.pth
- Torch7 (help wanted)
- Chainer (help wanted)
- Face Detection
- Semantic Segmentation
- Image Style Transfer
- Object Detection
You can use the MMdnn model visualizer and submit your IR json file to visualize your model. In order to run the commands below, you will need to install requests, keras, and TensorFlow using your favorite package manager.
Use the Keras "inception_v3" model as an example again.
- Download the pre-trained models
$ mmdownload -f keras -n inception_v3
- Convert the pre-trained model files into an intermediate representation
$ mmtoir -f keras -w imagenet_inception_v3.h5 -o keras_inception_v3
- Open the MMdnn model visualizer and choose file keras_inception_v3.json
Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
The intermediate representation stores the network architecture in protobuf binary and pre-trained weights in NumPy native format.
[Note!] Currently the IR weights data is in NHWC (channel last) format.
We are working on other frameworks conversion and visualization, such as PyTorch, CoreML and so on. We're investigating more RNN related operators. Any contributions and suggestions are welcome! Details in Contribution Guideline.
Yu Liu (Peking University): Project Developer & Maintainer
Cheng CHEN (Microsoft Research Asia): Caffe, CNTK, CoreML Emitter, Keras, MXNet, TensorFlow
Jiahao YAO (Peking University): CoreML, MXNet Emitter, PyTorch Parser; HomePage
Ru ZHANG (Chinese Academy of Sciences): CoreML Emitter, DarkNet Parser, Keras, TensorFlow frozen graph Parser; Yolo and SSD models; Tests
Yuhao ZHOU (Shanghai Jiao Tong University): MXNet
Tingting QIN (Microsoft Research Asia): Caffe Emitter
Tong ZHAN (Microsoft): ONNX Emitter
Qianwen WANG (Hong Kong University of Science and Technology): Visualization
Licensed under the MIT license.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size mmdnn-0.3.1-py2.py3-none-any.whl (318.9 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size mmdnn-0.3.1.tar.gz (241.3 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for mmdnn-0.3.1-py2.py3-none-any.whl