- Notifications
You must be signed in to change notification settings - Fork959
MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.
License
microsoft/MMdnn
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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.
Model Retraining
- During the model conversion, we generate some code snippets to simplify later retraining or inference.
Model Search & Visualization
- We provide amodel collection to help you find some popular models.
- We provide amodel visualizer to display the network architecture more intuitively.
Model Deployment
Targeting at openness and advancing state-of-art technology,Microsoft Research (MSR) andMicrosoft Software Technology Center (STC) had also released few other open source projects:
- 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 havePython installedor you can try the newest version by
pip install -U git+https://github.com/Microsoft/MMdnn.git@master
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.
- Caffe
- Microsoft Cognitive Toolkit (CNTK)
- CoreML
- Keras
- MXNet
- ONNX (Destination only)
- PyTorch
- 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 someImageNet models.
| Models | Caffe | Keras | TensorFlow | CNTK | MXNet | PyTorch | CoreML | ONNX |
|---|---|---|---|---|---|---|---|---|
| VGG 19 | √ | √ | √ | √ | √ | √ | √ | √ |
| Inception V1 | √ | √ | √ | √ | √ | √ | √ | √ |
| Inception V3 | √ | √ | √ | √ | √ | √ | √ | √ |
| Inception V4 | √ | √ | √ | o | √ | √ | √ | √ |
| ResNet V1 | × | √ | √ | o | √ | √ | √ | √ |
| ResNet V2 | √ | √ | √ | √ | √ | √ | √ | √ |
| MobileNet V1 | × | √ | √ | o | √ | √ | √ | √ |
| MobileNet V2 | × | √ | √ | o | √ | √ | √ | √ |
| Xception | √ | √ | √ | o | × | √ | √ | √ |
| SqueezeNet | √ | √ | √ | √ | √ | √ | √ | √ |
| DenseNet | √ | √ | √ | √ | √ | √ | √ | √ |
| NASNet | x | √ | √ | o | √ | √ | √ | x |
| ResNext | √ | √ | √ | √ | √ | √ | √ | √ |
| voc FCN | √ | √ | ||||||
| Yolo3 | √ | √ |
One command to achieve the conversion. Using TensorFlowResNet 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
Done.
- Torch7 (help wanted)
- Chainer (help wanted)
- Face Detection
- Semantic Segmentation
- Image Style Transfer
- Object Detection
- RNN
We provide alocal visualizer to display the network architecture of a deep learning model.Please refer to theinstruction.
Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to and actually do, grant usthe rights to use your contribution. For details, visithttps://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to providea CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructionsprovided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted theMicrosoft Open Source Code of Conduct.For more information see theCode of Conduct FAQ orcontactopencode@microsoft.com with any additional questions or comments.
The intermediate representation stores thenetwork architecture inprotobuf binary andpre-trained weights inNumPy native format.
[Note!] Currently the IR weights data is in NHWC (channel last) format.
Details are inops.txt andgraph.proto. New operators and any comments are welcome.
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 inContribution 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
Thanks toSaumitro Dasgupta, the initial code ofcaffe -> IR converting is references to his projectcaffe-tensorflow.
Licensed under theMIT license.
About
MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
