mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
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 |
||
|---|---|---|
| .. | ||
| bin | ||
| tests | ||
| __init__.py | ||
| backend_cpp_rep.py | ||
| backend_rep.py | ||
| backend.py | ||
| error.py | ||
| frontend.py | ||
| helper.py | ||
| onnxifi.py | ||
| ONNXOpCoverage.md | ||
| README.md | ||
| test_onnxifi.py | ||
| workspace.py | ||
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/