This tool converts pytorch model to Caffe model by ONNX
only use for inference
20230315: change pool roundmethod to floor, which pytorch used. add centernet example, pretrained from mmdetection.
- caffe (with python support)
- pytorch 0.4 (optional if you only want to convert onnx)
- onnx
git clone https://github.com/chenjun2hao/onnx2caffe.git
python setup.py install
or install on develop mode
python setup.py develop
just run in terminal
onnx2caffe ./model/MobileNetV2.onnx ./model/MobileNetV2.prototxt ./model/MobileNetV2.caffemodel
- Conv
- ConvTranspose
- BatchNormalization
- MaxPool
- AveragePool
- Relu
- Sigmoid
- Dropout
- Gemm (InnerProduct only)
- Add
- Mul
- Reshape
- Upsample
- Concat
- Flatten
- support all onnx operations (which is impossible)
- merge batchnormization to convolution
- merge scale to convolution