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.
Перейти к файлу
Kit c4aba456d0 Enable parallel pytest. 2018-02-09 13:33:15 +08:00
docs Add mxnet resnext-50 result. 2018-02-02 15:08:32 +08:00
mmdnn Refactor pytest and integrate the tensorflow tester. 2018-02-09 11:45:19 +08:00
tests Enable parallel pytest. 2018-02-09 13:33:15 +08:00
.gitignore ignore package-lock 2018-01-22 03:43:09 +00:00
ISSUE_TEMPLATE.md Update ISSUE_TEMPLATE.md 2018-01-17 16:25:01 +08:00
LICENSE Initial commit 2017-08-16 01:03:58 -07:00
README.md MXNet -> Cntk resnext test passed. 2018-02-08 15:48:51 +08:00
setup.py version updated. 2017-12-18 16:14:09 +08:00

README.md

MMdnn MMdnn

License

A comprehensive, cross-framework solution to convert, visualize and diagnosis deep neural network models. The "MM" in MMdnn stands for model management and "dnn" is an acronym for deep neural network.

Basically, it converts many DNN models that trained by one framework into others. The major features include:

  • Model File Converter Converting DNN models between frameworks
  • Model Code Snippet Generator Generating training or inference code snippet for frameworks
  • Model Visualization Visualizing DNN network architecture and parameters for frameworks
  • Model compatibility testing (On-going)

Installation

You can get stable version of MMdnn by

pip install https://github.com/Microsoft/MMdnn/releases/download/0.1.2/mmdnn-0.1.2-py2.py3-none-any.whl

or you can try the newest version by

pip install -U git+https://github.com/Microsoft/MMdnn.git@master

Features

Model Conversion

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.

Support frameworks

[Note] You can click the links to get detail README of each framework

Tested models

The model conversion between currently supported frameworks is tested on some ImageNet models.

Models Caffe Keras Tensorflow CNTK MXNet PyTorch CoreML
Inception V1 x (No LRN)
Inception V3 ×
Inception V4
ResNet V1 50 × o
ResNet V2 152
VGG 19
MobileNet_v1 × × (no DepthwiseConv) × ×
Xception × × (no SeparableConv) × ×
SqueezeNet ×
DenseNet
NASNet × (no SeparableConv)
[ResNext]

On-going frameworks

  • PyTorch (Source)
  • CNTK (Source)
  • Caffe2
  • ONNX

Model Visualization

You can use the MMdnn model visualizer and submit your IR json file to visualize your model.

Use the Keras "inception_v3" model as an example again.

  1. Download the pre-trained models
python -m mmdnn.conversion.examples.keras.extract_model -n inception_v3
  1. Convert the pre-trained model files into intermediate representation
python3 -m mmdnn.conversion._script.convertToIR -f keras -d keras_inception_v3 -n imagenet_inception_v3.json
  1. Open the MMdnn model visualizer and choose file keras_inception_v3.json

Inception_v3


Examples

Offical Tutorial

Users' Examples


Contributing

Intermediate Representation

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.

Details are in ops.txt and graph.proto. New operators and any comments are welcome.

Frameworks

We are working on other frameworks conversion and visualization, such as Caffe2, PyTorch, CoreML and so on. And more RNN related operators are investigating. Any contributions and suggestions are welcome!

License

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.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Acknowledgements

Thanks to Saumitro Dasgupta, the initial code of caffe -> IR converting is references to his project caffe-tensorflow.