pytorch/caffe2/python/onnx
Amy Yang 9588cd921e weight_names bug fix (#23848)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23848

Problem:
In experiment running feed model 127607201 (/mnt/public/tracelog/feed_repro2/127607201_0.predictor), encountered blob dimensionality mismatch error when running onnxified net. This is due to the model initializing input blobs in current workspace with blob size 0, and onnxifi() falsely identified those input blobs as weight blobs and assigned wrong dimension.

Solution:
Add option to pass correct weight blob names to onnxifi() instead of using all blobs in current workspace.

Reviewed By: yinghai

Differential Revision: D16661396

fbshipit-source-id: cabe44db6b64e6538bef4b65e380312214b3ba9f
2019-08-06 10:58:43 -07:00
..
bin Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
tests Automatic update of fbcode/onnx to 707064980b9825b8705b9d1c9aad34d8b022d5dd (#22981) 2019-07-17 14:05:14 -07:00
__init__.py
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
backend.py Add ONNX export support for torch.rand. (#20559) 2019-06-03 16:09:01 -07:00
error.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
frontend.py Fix caffe2 => onnx exporter for ConvTranspose (#14143) 2018-11-26 15:51:42 -08:00
helper.py Add debug logic to c2_ref_test and its helpers (#19359) 2019-04-22 12:08:55 -07:00
onnxifi.py weight_names bug fix (#23848) 2019-08-06 10:58:43 -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 Skip tests if C2/ONNX models cannot be read (#18494) 2019-03-27 11:21:44 -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