Coder Social home page Coder Social logo

How to convert Mxnet to Caffe? about mmdnn HOT 5 CLOSED

microsoft avatar microsoft commented on April 28, 2024
How to convert Mxnet to Caffe?

from mmdnn.

Comments (5)

TobeyQin avatar TobeyQin commented on April 28, 2024

You should first convert mxnet pre-trained model to IR(see here), and then convert IR to caffe.

I will take resnet152 model as an example:

  1. Convert mxnet to IR:
    python -m mmdnn.conversion._script.convertToIR -f mxnet -n mxnet/models/resnet-152-symbol.json -w mxnet/models/resnet-152-0000.params -d resnet152 --inputShape 3 224 224

  2. Convert IR to caffe code:
    python -m mmdnn.conversion._script.IRToCode -f caffe -n resnet152.pb -w resnet152.npy -d caffe_resnet152.py -dw caffe_resnet152.npy

  3. Generate caffe model from code:
    python caffe_resnet152.py -w caffe_resnet152.npy -p resnet152.prototxt -m resnet152.caffemodel

Hope this can help solve your question. Currently, from IR to caffe is under initial state, we haven't done enough test, if there is any issue when you use it, welcome to report.

from mmdnn.

tzhang2014 avatar tzhang2014 commented on April 28, 2024

thx , I have run the above example, when I run the first command , Loadiing I met three warnings: 1.MXNet Parser has not supported operator num with name data. 2. convert the null operator with name [data] into tnput layer. 3. SoftmaxOutput attrs are not supported in IR. So, When I run the second command ,I met a error that printf("=======current_node=======\n{}".format(current_node.layer),file=f)
SyntaxError: invalid syntax .
2018-02-08 16-32-38

from mmdnn.

kitstar avatar kitstar commented on April 28, 2024

Hi @tzhang2014 ,
Fixed. Please check the new module, Thanks.

from mmdnn.

gunasekaran7 avatar gunasekaran7 commented on April 28, 2024

I am trying to convert from IR to Caffe. And I am getting the following error. Any help would be appreciated.
I am using python3.4 and IR is created from a Keras model.
to_gh

from mmdnn.

kitstar avatar kitstar commented on April 28, 2024

Hi @gunasekaran7 , looks like there are some problem on Caffe Environment. Could you check it?

from mmdnn.

Related Issues (20)

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.