Skip to content

v0.2.1b3

Pre-release
Pre-release
Compare
Choose a tag to compare
@mitmul mitmul released this 28 Nov 09:24
· 887 commits to master since this release

ONNX-Chainer

This is an add-on package for ONNX support by Chainer.

Requirements

  • onnx==0.2.1
  • chainer>=3.1.0

Installation

See INSTALL.md

Quick Start

import numpy as np
import chainer.links as L
import onnx_chainer

model = L.VGG16Layers()

# Pseudo input
x = np.zeros((1, 3, 224, 224), dtype=np.float32)

onnx_chainer.export(model, x, filename='VGG16.onnx')

Supported Functions

Currently 50 Chainer Functions are supported to export in ONNX format.

Activation

  • ELU
  • HardSigmoid
  • LeakyReLU
  • LogSoftmax
  • PReLUFunction
  • ReLU
  • Sigmoid
  • Softmax
  • Softplus
  • Tanh

Array

  • Cast
  • Concat
  • Depth2Space
  • Pad 12
  • Reshape
  • Space2Depth
  • SplitAxis
  • Squeeze
  • Tile
  • Transpose

Connection

  • Convolution2DFunction
  • ConvolutionND
  • Deconvolution2DFunction
  • DeconvolutionND
  • EmbedIDFunction 3
  • LinearFunction

Math

  • Add
  • Absolute
  • Div
  • Mul
  • Neg
  • PowVarConst
  • Sub
  • Clip
  • Exp
  • Identity
  • MatMul 4
  • Maximum
  • Minimum
  • Sqrt
  • SquaredDifference
  • Sum

Noise

  • Dropout 5

Pooling

  • AveragePooling2D
  • AveragePoolingND
  • MaxPooling2D
  • MaxPoolingND

Normalization

  • BatchNormalization
  • FixedBatchNormalization
  • LocalResponseNormalization

1: mode should be either 'constant', 'reflect', or 'edge'

2: ONNX doesn't support multiple constant values for Pad operation

3: Current ONNX doesn't support ignore_label for EmbedID

4: Current ONNX doesn't support transpose options for matmul ops

5: In test mode, all dropout layers aren't included in the exported file