This is a method that can convert torch model to mxnet and the params are delivered by msgpack. Msgpack can be also used to other model convertion. The original model consists of many kind of layers, such as conv, relu, leakyRelu, deconv, batchNorm, tanh, and so on. So it almost includes most kinds of the convertion case.
To make your convertion runs smoothly, firstly, you should install the torch, python and the corresponding msgpack package separately.
- install u-masgpack-python
sudo pip install u-msgpack-python
- install lua messagepack
luarocks install lua-messagepack
git clone https://github.com/June01/torch2mxnet_msgpack.git
cd torch2mxnet_msgpack
th export_msgpack.lua
Attention: If your model structure is not the same with me, please remember to modify it and aslomodel_path
and save_path
.
python build_model_mx.py
Attention: If your model structure is not the same with me, please remember to modify it and also import_msgpack.py
.
If you have questions with it, please open an issue or email me([email protected])
.