pytorch/caffe2/python/onnx
Benoit Steiner 63ce3fbde8 Created a transformer to convertr caffe2 NetDef into ONNX models.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13167

Reviewed By: abadams

Differential Revision: D11296189

fbshipit-source-id: 7e49c7a78d26f4af39d50b40f70372272debb34a
2018-10-26 15:57:53 -07:00
..
bin Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
tests Disable upsample optest (#13135) 2018-10-25 20:37:09 -07:00
__init__.py Move onnx-caffe2 inside caffe2 (#1921) 2018-02-20 13:56:52 -08:00
backend.py Add randn in onnx symbolic (#12880) 2018-10-25 14:11:23 -07:00
backend_cpp_rep.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
backend_rep.py Rename cuda_gpu_id to device_id in DeviceOption (#12456) 2018-10-09 15:54:04 -07:00
error.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
frontend.py Add attribute exhaustive_search in _blacklist_caffe2_args (#12805) 2018-10-22 22:48:31 -07:00
helper.py [Caffe2] Scoped dummy name generator (#6458) 2018-04-16 11:58:02 -07:00
onnxifi.py Created a transformer to convertr caffe2 NetDef into ONNX models. 2018-10-26 15:57:53 -07:00
ONNXOpCoverage.md Update the ONNX op coverage in C2 2018-06-29 17:25:19 -07:00
README.md Add README and ONNXOpCoverage doc back (#2102) 2018-03-01 17:05:25 -08:00
test_onnxifi.py Enhance shape inference in ONNXIFI transformer (#12685) 2018-10-16 14:15:46 -07:00
workspace.py Disallow using the OOP api workspace as context managers (#6456) 2018-04-09 22:13:54 -07:00

Caffe2 implementation of Open Neural Network Exchange (ONNX)

Usage

Installation

onnx-caffe2 is installed as a part of Caffe2. Please follow the instructions to install Caffe2.

Folder Structure

  • ./: the main folder that all code lies under
    • frontend.py: translate from caffe2 model to onnx model
    • backend.py: execution engine that runs onnx on caffe2
  • tests/: test files

Testing

onnx-caffe2 uses pytest as test driver. In order to run tests, first you need to install pytest:

pip install pytest-cov

After installing pytest, do

pytest

to run tests.

Testing coverage issues/status: https://github.com/caffe2/caffe2/blob/master/caffe2/python/onnx/ONNXOpCoverage.md

Development

During development it's convenient to install caffe2 in development mode:

cd /path/to/caffe2
pip install -e caffe2/

License

MIT License