All code and functionalities of ONNX-Chainer have been merged into Chainer v7rc1 and this repository supports only bug fixes.
This is an add-on package for ONNX support by Chainer.
pip install onnx-chainer
$ pip install onnx-chainer[test-cpu]
Or, on GPU environment
$ pip install cupy # or cupy-cudaXX is useful
$ pip install onnx-chainer[test-gpu]
$ pytest -m "not gpu"
Or, on GPU environment
$ pytest
First, install ChainerCV to get the pre-trained models.
import numpy as np
import chainer
import chainercv.links as C
import onnx_chainer
model = C.VGG16(pretrained_model='imagenet')
# Pseudo input
x = np.zeros((1, 3, 224, 224), dtype=np.float32)
onnx_chainer.export(model, x, filename='vgg16.onnx')
Any contribution to ONNX-Chainer is welcome!
- Python codes follow Chainer Coding Guidelines