-
A conversion tool that can be used in linux environment to convert pytorch model to caffe model
-
Features:
- Can convert PyTorch model to caffe model correctly and without loss of accuracy
- Provide basic caffe verification function, able to verify the converted model
- Able to give pop-up error reminders for currently incompatible layers
- You can choose the path of the pytorch model and the save path of the converted caffe model
-
Supported Version:(Note that other versions have not been tested yet. You can try it out for yourself!)
- PyTorch -v1.4.0
- caffe - v1.0.0 https://github.com/BVLC/caffe
-
Supported Layer:
- conv2d
- conv2d_transpose
- linear
- max_pool2d
- avgpool_2d
- adaptive_avgpool2d
- relu
- leaky_relu
- batch_norm
- dropout
- softmax
-
Supported Operations: view(flatten), cat and other common torch operations.
- Open file convert_gui.py
- Import the .py file where the model definition is located (note that the name of the imported file is the name of the file when the model was saved)
- Import the .pth file of the model (note that the entire model is saved)
- Choose the save location after conversion(Where .protxt and .caffemodel will be saved)
- Set the input information
- Click the Convert button to start conversion
- Browse the detailed conversion process on the right
- convert error verify whether the conversion is successful
before conversion:
after conversion:
visualize the caffe model(using http://ethereon.github.io/netscope/#/editor)
- alexnet
- inception
- resnet
- darknet53
- mobilenetV2
- vggnet