Home

Awesome

Torch2Caffe2

Python and shell script to convert Torch models into Caffe2 protobuf files. The conversion uses ONNX-Caffe2 backend and has three steps like: Torch (.t7) -> PyTorch (.pth) -> ONNX (.onnx.pb) -> Caffe2 (.pb)

IMPORTANT: You need to specify the input dimension of the model.

Source Download

git clone --recursive git@github.com:ca1773130n/Torch2Caffe2.git

Requirements

NOTE:

Usage

torch_to_caffe2.sh <model_filename> <input_dimension>

Acknowledgement

This work is based on a GitHub project below.

Tested environment

Known Issues