Skip to main content

Convert a Chainer model into ONNX

Project description

ONNX-Chainer

PyPI GitHub license Build Status codecov Documentation Status

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.

Tested environment

see Tested environments

Installation

pip install onnx-chainer

Run Test

1. Install test modules

$ pip install onnx-chainer[test-cpu]

Or, on GPU environment

$ pip install cupy  # or cupy-cudaXX is useful
$ pip install onnx-chainer[test-gpu]

2. Run tests

$ pytest -m "not gpu"

Or, on GPU environment

$ pytest

Quick Start

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')

Supported Functions

see Supported Functions

Contribution

Any contribution to ONNX-Chainer is welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for onnx-chainer, version 1.6.0
Filename, size File type Python version Upload date Hashes
Filename, size onnx-chainer-1.6.0.tar.gz (30.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page