Model conversion tool collection and pytorch2caffe

Model Conversion Tool

github address: https://github.com/ysh329/deep-learning-model-convertor Some screenshots
of the model conversion are as follows: HiSilicon's own online conversion tool should use Microsoft's MMdnn ( https://github.com/ Microsoft/MMdnn )
1

pytorch2caffe

Attempt one (failed)

Many people on the Internet use https://github.com/longcw/pytorch2caffe
Unfortunately, the pytorch version requirement is lower than 0.4, it is too old, and the model cannot be loaded.
Although it failed in the end, I also wrote down the general steps for your reference.

1. Use the source code to install pytorch0.2 (I really can't find the installation package of the 0.2–CPU version)

2. import torchThe following problems occur

ImportError: /usr/local/share/anaconda2/envs/onnx_env/lib/python2.7/site-packages/torch/_C.so: undefined symbol: _ZN3MPI8Datatype4FreeEv

Searching in https://github.com/pytorch/pytorch/issues/2680 , someone said that there is a temporary solution isLD_PRELOAD=/usr/lib/libmpi_cxx.so python

At this time, you need to compile openmpi from the source code. Remember to add options before compiling --enable-mpi-cxx, so that there will be libmpi_cxx.sofiles.

Finally open python
LD_PRELOAD=/usr/local/openmpi/lib/libmpi_cxx.so python

load pytorch

Guess you like

Origin blog.csdn.net/qq_40421682/article/details/107034247