GithubHelp home page GithubHelp logo

gaoyiyeah / mmdnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/mmdnn

0.0 2.0 0.0 31.07 MB

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 and CoreML.

License: MIT License

Python 92.59% HTML 0.36% TypeScript 2.75% CSS 1.14% JavaScript 3.17%

mmdnn's Introduction

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)

This project is designed and developed by Microsoft Research (MSR). We also encourage researchers and students leverage this project to analysis DNN models and we welcome any new ideas to extend this project.

Installation

You can get stable version of MMdnn by

pip install mmdnn

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
voc-FCN8s/FCN16s/FCN32s

On-going frameworks

  • ONNX
  • PyTorch (Source, waiting for formal release 0.4.0)
  • Torch7 (Source)
  • CoreML (Source)
  • Chainer (help wants)

On-going Models

  • Semantic Segmentation
  • Image Style Transfer
  • Object Detection
  • RNN

Model Visualization

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.

  1. Download the pre-trained models
$ mmdownload -f keras -n inception_v3
  1. Convert the pre-trained model files into intermediate representation
$ mmtoir -f keras -w imagenet_inception_v3.h5 -o keras_inception_v3
  1. Open the MMdnn model visualizer and choose file keras_inception_v3.json

Inception_v3


Examples

Official 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 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 [email protected] 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.

mmdnn's People

Contributors

kitstar avatar namizzz avatar tobeyqin avatar gzuidhof avatar zhantong avatar jiahaoyao avatar liangfu avatar galli-leo avatar bharathgs avatar wangqianwen0418 avatar microsoftopensource avatar 2yz avatar luuil avatar zhangsodagreen avatar dhaase-de avatar kant avatar isikdogan avatar msftgits avatar skybigzhou avatar gongwuji avatar mwinkle avatar

Watchers

James Cloos avatar GRU avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.