pytorch/caffe2/python/onnx
Nikita Shulga eae84f0d5d Fix ONNX forward compatibility (#59327)
Summary:
Fixes `onnx.utils.polish_model` not found exception when executed using onnx-1.9

Pull Request resolved: https://github.com/pytorch/pytorch/pull/59327

Reviewed By: H-Huang

Differential Revision: D28840563

Pulled By: malfet

fbshipit-source-id: 403a29a88e7dee8b3414602b9fe2b31baf737dce
2021-06-02 12:39:56 -07:00
..
bin Drop unused imports from caffe2/python (#49980) 2021-01-05 13:17:46 -08:00
tests [ONNX] Update ONNX to rel-1.9 (#55889) (#57080) 2021-06-02 08:27:17 -07:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00
backend_cpp_rep.py Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
backend_rep.py Remove __future__ imports for legacy Python2 supports (#45033) 2020-09-23 17:57:02 -07:00
backend.py Fix ONNX forward compatibility (#59327) 2021-06-02 12:39:56 -07:00
error.py Remove __future__ imports for legacy Python2 supports (#45033) 2020-09-23 17:57:02 -07:00
frontend.py Remove redundant code for unsupported Python versions (#49486) 2021-01-06 12:45:46 -08:00
helper.py Drop unused imports from caffe2/python (#49980) 2021-01-05 13:17:46 -08:00
onnxifi.py Add onnxifi interface for set/get options (#52388) 2021-02-18 20:12:34 -08:00
ONNXOpCoverage.md Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
README.md Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
test_onnxifi.py Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
workspace.py Remove __future__ imports for legacy Python2 supports (#45033) 2020-09-23 17:57:02 -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