Chainer from/to NNOIR Converter
Project description
nnoir-chainer
Chainer Model from/to NNOIR converter
ATTENTION: This library goes into the maintenance phase too.
Install
pip install nnoir-chainer
Example
Import NNOIR
import chainer
from nnoir_chainer import NNOIRFunction
m = NNOIRFunction('nnoir_file_path')
x = chainer.Variable(np_array)
with chainer.using_config('train', False):
y = m(x)
print(y)
Export NNOIR
m = model.CNN()
chainer.serializers.load_npz('cnn.model', L.Classifier(m))
with chainer.using_config('train', False):
x = chainer.Variable(np.zeros((1, 28*28)).astype(np.float32))
y = m(x)
g = nnoir_chainer.Graph(m, (x,), (y,))
result = g.to_nnoir()
with open('model.nnoir', 'w') as f:
f.buffer.write(result)
These layers are supported by nnoir-chainer exporter.
- chainer.links
- BatchNormalization
- Bias
- Linear
- Convolution2D (DepthwiseConvolution2D, DilatedConvolution2D)
- Scale
- Swish
- chainer.function
- Add
- AddConstant
- AveragePooling2D
- ClippedReLU
- Concat
- Dropout
- ELU
- LeakyReLU
- MaxPooling2D
- Mul
- MulConstant
- Pad
- ReLU
- Reshape
- Sigmoid
- Softmax
- Sub
- Sum
- Tanh
- Transpose
- Unpooling2D
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for nnoir_chainer-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6b55d94bbadfa5621edcfef022852455c173b3b6acc50f0d7c396a96537f9a0 |
|
MD5 | 732c89c1d7ceba56491f1a905012b18d |
|
BLAKE2b-256 | 74c06f6c428978cdbe4d181c52c5094f9ab9e949d400bb120b4e2ea31ffac03d |